/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
}

/* Authentication Container */
.auth-container {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s ease;
}

.auth-container h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.auth-container p {
    color: #666;
    margin-bottom: 30px;
}

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

.auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
}

.auth-button img,
.auth-button svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.google-button {
    background-color: white;
    color: #444;
    border: 1px solid #ddd;
}

.google-button:hover {
    background-color: #f8f8f8;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.apple-button {
    background-color: black;
    color: white;
}

.apple-button:hover {
    background-color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Referral Container */
.referral-container {
    transition: all 0.4s ease;
}

.referral-card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.icon-container {
    margin-bottom: 20px;
}

.gift-icon {
    font-size: 64px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.referral-card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.referral-card p {
    color: #666;
    margin-bottom: 30px;
}

/* User Info Section */
.user-info {
    background: rgba(106, 17, 203, 0.05);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.user-email, .user-subscription, .user-premium-expiration, .user-tokens {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.user-tokens {
    margin-bottom: 0;
}

.info-label {
    font-weight: 500;
    color: #6a11cb;
    font-size: 14px;
}

.info-value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    background: white;
    padding: 4px 8px;
    border-radius: 8px;
    min-width: 60px;
    text-align: center;
}

.tokens-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.refresh-button:hover {
    opacity: 1;
    transform: rotate(180deg);
}

.refresh-button:active {
    transform: rotate(360deg);
}

.refresh-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Subscription Badge Styles */
.subscription-badge {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: auto;
}

.subscription-badge.pro {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B4513;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.subscription-badge.kid-pro {
    background: linear-gradient(135deg, #FF69B4, #FF1493);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 105, 180, 0.3);
}

.subscription-badge.free {
    background: linear-gradient(135deg, #E0E0E0, #BDBDBD);
    color: #555;
    box-shadow: 0 2px 4px rgba(189, 189, 189, 0.3);
}

/* Premium Expiration Date Styles */
.expiration-date {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 500;
}

.expiration-date.expires-soon {
    color: #FF5722;
    background: rgba(255, 87, 34, 0.1);
}

.expiration-date.expires-later {
    color: #4CAF50;
}

/* Install App Message Styles */
.install-app-message {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-radius: 16px;
    border: 2px solid #FF9800;
}

.install-app-message h2 {
    color: #E65100;
    margin-bottom: 15px;
    font-size: 22px;
}

.install-app-message p {
    color: #BF360C;
    margin-bottom: 15px;
    font-weight: 500;
}

.install-app-message ol {
    text-align: left;
    color: #BF360C;
    margin: 15px 0;
    padding-left: 20px;
}

.install-app-message li {
    margin-bottom: 8px;
    font-weight: 500;
}

.after-setup-note {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    color: #2E7D32;
    font-size: 14px;
    line-height: 1.4;
}

.after-setup-note strong {
    color: #1B5E20;
}

.app-download-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.download-link {
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.3);
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(255, 152, 0, 0.4);
}

.input-container {
    margin-bottom: 20px;
}

#referral-code {
    width: 100%;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(106, 17, 203, 0.3);
    background-color: rgba(106, 17, 203, 0.05);
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: bold;
    color: #6a11cb;
    outline: none;
    transition: all 0.3s ease;
}

#referral-code:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.2);
}

#referral-code::placeholder {
    color: rgba(106, 17, 203, 0.5);
    font-weight: normal;
}

/* Message Container */
.message-container {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 12px;
    border-radius: 12px;
    text-align: left;
}

.message-container.error {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.message-container.success {
    background-color: rgba(0, 128, 0, 0.1);
    border: 1px solid rgba(0, 128, 0, 0.3);
}

.message-icon {
    margin-right: 10px;
    font-size: 20px;
}

.message-container.error .message-icon::before {
    content: "⚠️";
}

.message-container.success .message-icon::before {
    content: "✅";
}

#message-text {
    flex: 1;
    font-size: 14px;
    margin: 0;
}

.message-container.error #message-text {
    color: #d32f2f;
}

.message-container.success #message-text {
    color: #388e3c;
}

/* Button Container */
.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.cancel-button {
    padding: 12px 24px;
    border: none;
    background: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.cancel-button:hover {
    background-color: #f5f5f5;
}

.submit-button {
    padding: 16px 32px;
    border: none;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.3);
    transition: all 0.2s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(106, 17, 203, 0.4);
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Initial Loader Styles */
.initial-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.05);
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(106, 17, 203, 0.1);
    border-top: 4px solid #6a11cb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-content p {
    color: #666;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Account Container Styles */
.account-container {
    transition: all 0.4s ease;
}

.account-card {
    background: white;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Account Header */
.account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.account-header h1 {
    flex: 1;
    margin: 0 20px;
    font-size: 24px;
}

.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Corporate Branding in Header */
.corporate-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.corporate-logo {
    height: 32px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 4px;
}

.corporate-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* Navigation Tabs */
.account-nav {
    display: flex;
    gap: 5px;
    padding: 20px 30px 0;
    background: white;
    border-bottom: 2px solid #f0f0f0;
    overflow-x: auto;
}

.nav-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    color: #6a11cb;
    background: rgba(106, 17, 203, 0.05);
    border-radius: 8px 8px 0 0;
}

.nav-tab.active {
    color: #6a11cb;
    border-bottom-color: #6a11cb;
}

/* Tab Content */
.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Info Card */
.user-info-card {
    background: rgba(106, 17, 203, 0.05);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.user-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-info-row:last-child {
    margin-bottom: 0;
}

/* History Tab Styles */
.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    color: white;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.1);
}

.icon-button {
    padding: 12px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-button:hover {
    background: #f5f5f5;
    transform: rotate(180deg);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s ease;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.history-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.history-item-date {
    font-size: 12px;
    color: #999;
}

.history-item-barcode {
    font-size: 13px;
    color: #666;
    font-family: 'Courier New', monospace;
}

.history-item-actions {
    display: flex;
    gap: 5px;
}

.history-item-actions button {
    padding: 4px 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.history-item-actions button:hover {
    background: #f0f0f0;
}

/* Achievements Tab Styles */
.leaderboard-card {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    color: #8B4513;
}

.leaderboard-card h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
}

.leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-item .stat-label {
    font-size: 12px;
    opacity: 0.8;
}

.stat-item .stat-value {
    font-size: 24px;
    font-weight: bold;
}

.badges-section, .achievements-section {
    margin-bottom: 30px;
}

.badges-section h3, .achievements-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.badge-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s ease;
}

.badge-item:hover {
    border-color: #6a11cb;
    box-shadow: 0 2px 8px rgba(106, 17, 203, 0.2);
}

.badge-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.badge-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.achievement-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f5f5f5;
}

.filter-btn.active {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-color: transparent;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.achievement-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s ease;
}

.achievement-item.completed {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

.achievement-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.achievement-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.achievement-description {
    font-size: 13px;
    color: #666;
}

.achievement-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.achievement-status.completed {
    background: #4CAF50;
    color: white;
}

.achievement-status.in-progress {
    background: #FF9800;
    color: white;
}

.achievement-progress {
    margin-top: 10px;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Profile Tab Styles */
.profile-section {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
}

.profile-picture-section {
    text-align: center;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #6a11cb;
    margin-bottom: 15px;
}

.profile-picture-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.3);
}

.delete-btn {
    padding: 10px 16px;
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #ff1744;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-input {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.1);
}

.form-input:readonly {
    background: #f5f5f5;
    cursor: not-allowed;
}

.primary-button {
    padding: 14px 24px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.3);
}

.form-message {
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
}

.form-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #2E7D32;
    border: 1px solid #4CAF50;
}

.form-message.error {
    background: rgba(255, 82, 82, 0.1);
    color: #c62828;
    border: 1px solid #ff5252;
}

/* Privacy Tab Styles */
.privacy-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.privacy-section h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.privacy-section p {
    color: #666;
    margin-bottom: 15px;
}

.privacy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.3);
}

.warning-button {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.warning-button:hover {
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
}

.danger-button {
    background: linear-gradient(135deg, #ff5252, #ff1744);
}

.danger-button:hover {
    box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
}

.danger-section {
    border-color: #ff5252;
    background: rgba(255, 82, 82, 0.05);
}

.deletion-preview {
    background: white;
    border: 1px solid #ff5252;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
}

.deletion-preview h4 {
    margin: 0 0 10px 0;
    color: #c62828;
}

.deletion-preview ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

/* Loading Spinner Small */
.loader-spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(106, 17, 203, 0.1);
    border-top: 3px solid #6a11cb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 16px;
}

/* Code Confirmation Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 28px;
}

.modal-corporate-branding {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
}

.modal-corporate-logo {
    max-height: 80px;
    max-width: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 12px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-corporate-name {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.modal-description {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.modal-code-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.modal-code-value {
    font-size: 18px;
    font-weight: 700;
    color: #6a11cb;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
}

.modal-button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-cancel {
    background: #e9ecef;
    color: #495057;
}

.modal-cancel:hover {
    background: #dee2e6;
}

.modal-activate {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.modal-activate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }

    .account-header {
        padding: 15px 20px;
    }

    .account-header h1 {
        font-size: 20px;
        margin: 0 10px;
    }

    .header-logo {
        width: 40px;
        height: 40px;
    }

    .account-nav {
        padding: 15px 20px 0;
    }

    .nav-tab {
        padding: 10px 15px;
        font-size: 14px;
    }

    .tab-content {
        padding: 20px;
    }

    .profile-section {
        grid-template-columns: 1fr;
    }

    .history-stats {
        grid-template-columns: 1fr;
    }

    .leaderboard-stats {
        grid-template-columns: 1fr;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

@media (max-width: 480px) {
    .auth-container, .referral-card {
        padding: 20px;
    }

    .auth-container h1, .referral-card h2 {
        font-size: 20px;
    }

    .user-info {
        padding: 12px;
    }

    .info-label, .info-value {
        font-size: 13px;
    }

    .user-email, .user-subscription, .user-premium-expiration, .user-tokens {
        margin-bottom: 6px;
    }

    .install-app-message {
        padding: 15px;
    }

    .install-app-message h2 {
        font-size: 20px;
    }

    .app-download-links {
        flex-direction: column;
    }

    .button-container {
        flex-direction: column;
        gap: 15px;
    }

    .cancel-button, .submit-button {
        width: 100%;
    }

    .account-header {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .header-logo {
        order: 1;
        width: 50px;
        height: 50px;
    }

    .account-header h1 {
        order: 3;
        width: 100%;
        margin: 10px 0;
    }

    .logout-btn {
        order: 2;
    }

    .privacy-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
        justify-content: center;
    }
}

/* Email/Password Authentication Styles */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 10px 0;
    color: #999;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.auth-divider span {
    padding: 0 15px;
}

.email-button {
    background-color: #4A90E2;
    color: white;
    border: none;
}

.email-button:hover {
    background-color: #357ABD;
    box-shadow: 0 2px 5px rgba(74, 144, 226, 0.3);
}

.email-password-form {
    margin-top: 20px;
    text-align: left;
}

.email-password-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-password-form input[type="email"],
.email-password-form input[type="password"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.email-password-form input[type="email"]:focus,
.email-password-form input[type="password"]:focus {
    outline: none;
    border-color: #4A90E2;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.primary-button {
    flex: 1;
    padding: 12px 20px;
    background-color: #4A90E2;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-button:hover {
    background-color: #357ABD;
    box-shadow: 0 2px 5px rgba(74, 144, 226, 0.3);
}

.secondary-button {
    flex: 1;
    padding: 12px 20px;
    background-color: white;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background-color: #f8f8f8;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.text-link {
    background: none;
    border: none;
    color: #4A90E2;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.text-link:hover {
    color: #357ABD;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}
