/* Venerekisteri Plugin Styles */

/* Profile page styling */
.form-table .venerekisteri-section {
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 20px 0;
}

.form-table .venerekisteri-section h3 {
    margin-top: 0;
    color: #0073aa;
}

/* WooCommerce My Account page styling */
.woocommerce-account .venerekisteri-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.woocommerce-account .venerekisteri-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.woocommerce-account .venerekisteri-section .form-table {
    margin: 0;
}

.woocommerce-account .venerekisteri-section .form-table th {
    width: 30%;
    padding: 12px 0;
    font-weight: 600;
    color: #333;
    vertical-align: top;
}

.woocommerce-account .venerekisteri-section .form-table td {
    padding: 12px 0;
}

.woocommerce-account .venerekisteri-section .form-table input[type="text"],
.woocommerce-account .venerekisteri-section .form-table input[type="tel"],
.woocommerce-account .venerekisteri-section .form-table textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.woocommerce-account .venerekisteri-section .form-table input:focus,
.woocommerce-account .venerekisteri-section .form-table textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.woocommerce-account .venerekisteri-section .form-table textarea {
    min-height: 100px;
    resize: vertical;
}

.woocommerce-account .venerekisteri-section .form-table tr.focused {
    background: #f0f8ff;
    border-left: 3px solid #0073aa;
    transition: all 0.3s ease;
}

.woocommerce-account .venerekisteri-section .form-table tr.focused th,
.woocommerce-account .venerekisteri-section .form-table tr.focused td {
    background: transparent;
}

/* Registration form styling */
.venerekisteri-field {
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.venerekisteri-field.focused {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.venerekisteri-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.venerekisteri-field input[type="text"],
.venerekisteri-field input[type="tel"],
.venerekisteri-field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.venerekisteri-field textarea {
    min-height: 80px;
    resize: vertical;
}

.venerekisteri-field input:focus,
.venerekisteri-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

/* Error states */
.venerekisteri-field input.error,
.venerekisteri-field textarea.error,
.woocommerce-account .venerekisteri-section .form-table input.error,
.woocommerce-account .venerekisteri-section .form-table textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

.venerekisteri-field input.error:focus,
.venerekisteri-field textarea.error:focus,
.woocommerce-account .venerekisteri-section .form-table input.error:focus,
.woocommerce-account .venerekisteri-section .form-table textarea.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
}

/* User list table styling */
.wp-list-table .column-omistajan_nimi,
.wp-list-table .column-veneen_nimi,
.wp-list-table .column-toimipaikka,
.wp-list-table .column-puhelinnumero {
    width: 15%;
}

.wp-list-table .column-veneen_kuva {
    width: 80px;
    text-align: center;
}

.wp-list-table .column-omistajan_nimi {
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .form-table .venerekisteri-section {
        padding: 10px;
    }
    
    .woocommerce-account .venerekisteri-section {
        padding: 15px;
    }
    
    .woocommerce-account .venerekisteri-section .form-table th,
    .woocommerce-account .venerekisteri-section .form-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }
    
    .venerekisteri-field input[type="text"],
    .venerekisteri-field input[type="tel"],
    .venerekisteri-field textarea,
    .woocommerce-account .venerekisteri-section .form-table input[type="text"],
    .woocommerce-account .venerekisteri-section .form-table input[type="tel"],
    .woocommerce-account .venerekisteri-section .form-table textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .venerekisteri-field.focused {
        padding: 8px;
    }
}

/* Admin notice styling */
.venerekisteri-notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 12px;
    margin: 15px 0;
    color: #0c5460;
    animation: slideIn 0.3s ease;
}

.venerekisteri-notice.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.venerekisteri-notice.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Animation for notices */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.venerekisteri-field.loading {
    position: relative;
}

.venerekisteri-field.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success state */
.venerekisteri-field.success input,
.venerekisteri-field.success textarea,
.woocommerce-account .venerekisteri-section .form-table .success input,
.woocommerce-account .venerekisteri-section .form-table .success textarea {
    border-color: #28a745;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

/* Field error messages */
.field-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.woocommerce-account .field-error-message {
    font-size: 13px;
    margin-top: 8px;
    color: #dc3545;
}

/* Animation for error messages */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Field group styling */
.venerekisteri-field-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.venerekisteri-field-group .venerekisteri-field {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .venerekisteri-field-group {
        flex-direction: column;
    }
}

/* Image upload styling */
.venerekisteri-image-upload {
    position: relative;
}

.venerekisteri-file-input {
    margin-bottom: 10px;
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.venerekisteri-file-input:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.venerekisteri-file-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.venerekisteri-image-preview {
    margin: 15px 0;
    padding: 15px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    text-align: center;
}

.venerekisteri-preview-image {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
    display: block;
}

.venerekisteri-preview-image img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 10px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.venerekisteri-upload-progress {
    color: #0073aa;
    font-style: italic;
    margin: 10px 0;
}

.venerekisteri-upload-info {
    color: #28a745;
    font-style: italic;
    margin: 10px 0;
    font-weight: 500;
}

.venerekisteri-remove-image {
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: background-color 0.3s ease !important;
}

.venerekisteri-remove-image:hover {
    background: #c82333 !important;
}

/* WooCommerce specific image upload styling */
.woocommerce-account .venerekisteri-image-upload .venerekisteri-file-input {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

.woocommerce-account .venerekisteri-preview-image {
    max-width: 250px;
    max-height: 150px;
}

.woocommerce-account .venerekisteri-remove-image {
    margin-top: 10px;
    width: auto;
    display: inline-block;
}

/* Responsive image upload */
@media (max-width: 768px) {
    .venerekisteri-preview-image {
        max-width: 100%;
        height: auto;
    }
    
    .venerekisteri-file-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .woocommerce-account .venerekisteri-preview-image {
        max-width: 100%;
        height: auto;
    }
}

/* Boat image display styling */
.venerekisteri-boat-image-display {
    text-align: center;
    margin: 15px 0;
}

.venerekisteri-boat-image {
    max-width: 400px;
    max-height: 300px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}

/* Responsive boat image display */
@media (max-width: 768px) {
    .venerekisteri-boat-image {
        max-width: 100%;
        height: auto;
    }
} 