/* Prevent zoom on mobile */
* {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

:root {
    --primary: #0171ce;
    --secondary: #fcb61a;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-light: #ffffff;
    --card-dark: #1e293b;
    --text-light: #1e293b;
    --text-dark: #f1f5f9;
    --border-light: #e2e8f0;
    --border-dark: #334155;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-dark: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --success: #10b981;
    --error: #ef4444;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

/* Vendor Plan Badges */
.plan-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.launch {
    background: rgba(1, 113, 206, 0.1);
    color: #0171ce;
    border: 1px solid #0171ce;
}

.plan-badge.scale {
    background: rgba(252, 182, 26, 0.1);
    color: #d69900;
    border: 1px solid #fcb61a;
}

.plan-badge.growth {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid #10b981;
}

/* Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Close button for sidebar */
.sidebar-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.light-mode .sidebar-close:hover {
    background: rgba(0,0,0,0.1);
}

.dark-mode .sidebar-close:hover {
    background: rgba(255,255,255,0.1);
}

/* Auth Pages Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #0156a3 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.auth-card {
    background: var(--card-light);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-light);
}

.dark-mode .auth-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 16px;
    object-fit: contain;
}

.auth-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-light);
    opacity: 0.7;
    font-size: 16px;
}

.dark-mode .auth-subtitle {
    color: var(--text-dark);
}

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

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

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
}

.dark-mode .form-label {
    color: var(--text-dark);
}

.form-input {
    padding: 16px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-light);
    color: var(--text-light);
    transition: all 0.2s ease;
}

.dark-mode .form-input {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(1, 113, 206, 0.1);
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.password-input-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.dark-mode .toggle-password {
    color: var(--text-dark);
}

.toggle-password:hover {
    background: rgba(0, 0, 0, 0.1);
}

.dark-mode .toggle-password:hover {
    background: rgba(255, 255, 255, 0.1);
}

.auth-button {
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, var(--primary), #0156a3);
    color: white;
    margin-top: 8px;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(1, 113, 206, 0.3);
}

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

.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.dark-mode .auth-footer {
    border-top-color: var(--border-dark);
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #0156a3;
    text-decoration: underline;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* Field Error */
.field-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Approval Notice */
.approval-notice {
    background: rgba(252, 182, 26, 0.1);
    border: 1px solid rgba(252, 182, 26, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.approval-notice i {
    color: #fcb61a;
    margin-right: 8px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar-close {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content.sidebar-open {
        margin-left: 0;
    }
    
    .auth-card {
        padding: 32px 24px;
    }
    
    .auth-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 16px;
    }
    
    .auth-title {
        font-size: 24px;
    }
}

/* Ensure no zoom on input focus */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0156a3;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.dark-mode .skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
