* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    padding: 40px 30px;
    color: #2d3436;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-link {
    flex-shrink: 0;
}

.logo-img {
    height: 60px;
    width: auto;
}

.header-text {
    flex: 1;
    text-align: center;
    margin: 0 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

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

main {
    padding: 40px 30px;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-box {
    border: 3px dashed #74b9ff;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: #0984e3;
    background: #e8f4ff;
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: #00b894;
    background: #e8f8f5;
}

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

.upload-content p {
    margin: 10px 0;
    color: #636e72;
}

.file-info {
    font-size: 0.9rem;
    color: #74b9ff;
}

.preview-section {
    position: relative;
    text-align: center;
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-section {
    text-align: center;
    margin: 30px 0;
}

.analyze-btn {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
}

.analyze-btn:disabled {
    background: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-loader {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.results-section {
    background: #f8f9ff;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
}

.results-section h3 {
    color: #2d3436;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.exif-section {
    background: #e8f4ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #74b9ff;
}

.exif-section h4 {
    color: #2d3436;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.exif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.exif-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.exif-label {
    font-weight: 600;
    color: #2d3436;
}

.exif-value {
    color: #636e72;
    font-family: 'Courier New', monospace;
}

.critique-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border-left: 5px solid #00b894;
    line-height: 1.6;
    color: #2d3436;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.error-section {
    background: #ffe0e0;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border-left: 5px solid #e74c3c;
}

.error-content {
    color: #c0392b;
    font-weight: 500;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #00b894;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
    z-index: 1000;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* User Menu Improvements */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    background: #74b9ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background: #0984e3;
}

.auth-btn.primary {
    background: #00b894;
}

.auth-btn.primary:hover {
    background: #00a085;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #2d3436;
    font-weight: 500;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: #74b9ff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.dropdown-btn:hover {
    background: #0984e3;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 5px;
    z-index: 1000;
    margin-top: 5px;
    border: 1px solid #e9ecef;
}

.dropdown-content a {
    color: #2d3436;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

/* Ensure the user menu has proper positioning */
.user-menu {
    position: relative;
}

.dropdown-content a {
    color: #2d3436;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.dropdown-content a:first-child {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.dropdown-content a:last-child {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

/* Account Page Styles */
.account-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background: #5a6268;
}

.critique-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.critique-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-color: #74b9ff;
}

.critique-preview h4 {
    color: #2d3436;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.critique-preview p {
    color: #636e72;
    margin: 0;
    line-height: 1.5;
}

.critique-detail-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

.detail-header h2 {
    margin: 0;
    color: #2d3436;
}

.critique-meta {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.critique-text {
    line-height: 1.6;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .header-text {
        margin: 0;
        order: 1;
    }

    .logo-link {
        order: 0;
    }

    .user-menu {
        order: 2;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 30px 20px;
    }

    .upload-box {
        padding: 30px 15px;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .account-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .dropdown-content {
        position: fixed;
        right: 20px;
        left: 20px;
        width: auto;
    }
}