/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #1a365d;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Logo Styles */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 250px;
    height: auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card h2 {
    color: #1a365d;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #1a365d;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #e67e22;
    background-color: #f8f9ff;
}

#photo-input {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: #1a365d;
    font-size: 1.2rem;
    font-weight: 500;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

#preview-container {
    margin-top: 20px;
}

#photo-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Loading Spinner */
#loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a365d;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Small spinner for inline loading */
.spinner-small {
    display: inline-block;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a365d;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9rem;
}

/* Toggle Switch Styles */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f0f4f8;
    border-radius: 6px;
}

.toggle-group > label {
    margin-bottom: 0;
    flex: 1;
}

.toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 34px;
    background-color: #27ae60;
    border-radius: 34px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 0;
}

.toggle-input:not(:checked) + .toggle-label {
    background-color: #ccc;
}

.toggle-label::before {
    content: '';
    position: absolute;
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-input:checked + .toggle-label::before {
    transform: translateX(46px);
}

.toggle-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    user-select: none;
}

.toggle-input:checked + .toggle-label .toggle-text {
    left: 10px;
}

.toggle-input:checked + .toggle-label .toggle-text::after {
    content: 'Yes';
}

.toggle-input:not(:checked) + .toggle-label .toggle-text {
    right: 10px;
    left: auto;
}

.toggle-input:not(:checked) + .toggle-label .toggle-text::after {
    content: 'No';
}

/* Buttons */
.btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #e67e22;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
    background: #d35400;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Success Section */
#success-section {
    text-align: center;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

#success-section h2 {
    color: white;
    font-size: 2.5rem;
}

#success-section p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Error Section */
.error-card {
    background: #fff5f5;
    border: 2px solid #fc8181;
}

.error-card h3 {
    color: #c53030;
    margin-bottom: 10px;
}

.error-card p {
    color: #742a2a;
    margin-bottom: 15px;
}

.error-button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.error-button-group .btn {
    flex: 1;
    min-width: 120px;
}

/* Example Photos Section */
.examples-section {
    margin-top: 20px;
}

.examples-section h3 {
    color: #1a365d;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-align: center;
}

.examples-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.example-frame {
    flex: 1;
    max-width: 360px;
    text-align: center;
}

.example-frame img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.example-frame.good img {
    border-color: #27ae60;
}

.example-frame.bad img {
    border-color: #e74c3c;
}

.example-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.example-frame.good .example-indicator {
    color: #27ae60;
}

.example-frame.bad .example-indicator {
    color: #e74c3c;
}

.example-indicator .icon {
    font-size: 1.2rem;
    margin-right: 5px;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .logo {
        max-width: 180px;
    }
    
    .examples-container {
        flex-direction: row;
        gap: 10px;
    }
    
    .example-frame {
        max-width: 280px;
    }
    
    .example-frame img {
        height: 180px;
    }
}
