/* Modern Dashboard - Light Theme with Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 48px;
    width: 100%;
    max-width: 650px;
}

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

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--gray-600);
    font-size: 16px;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

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

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    color: var(--gray-500);
    font-size: 13px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: var(--white);
    box-shadow: none;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5558e3 0%, #7c4de0 100%);
    transform: none;
    box-shadow: none;
}

.btn-primary:active {
    background: linear-gradient(135deg, #4a4dc9 0%, #6d3ec7 100%);
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled {
    background: #c7d2fe;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-google {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    box-shadow: none;
}

.btn-google:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    box-shadow: none;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--gray-400);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider span {
    padding: 0 16px;
    font-weight: 500;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 24px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 14px;
    color: var(--gray-500);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.nav-item.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: var(--white);
    box-shadow: none;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 40px;
    width: calc(100% - 280px);
    background: var(--gray-50);
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--gray-600);
    font-size: 16px;
}

/* Content Card */
.content-card {
    background: var(--white);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.alert-info {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    border-left: 4px solid #6366f1;
}

.alert-info h3 {
    color: #4338ca;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.alert-info p {
    color: #4338ca;
    margin-bottom: 8px;
}

.alert-info ul {
    color: #4338ca;
    margin-left: 24px;
    margin-top: 8px;
}

/* Code Block */
.code-block {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
    margin: 16px 0;
    position: relative;
}

.code-block code {
    color: #a5f3fc;
}

/* API Key Display */
.api-key-box {
    background: var(--gray-900);
    color: var(--white);
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.api-key-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #a5f3fc;
    word-break: break-all;
}

/* Messages */
.error-message,
.success-message {
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    font-size: 18px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.mobile-overlay.show {
    display: block;
}

/* Responsive Tablet */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        width: calc(100% - 240px);
        padding: 30px 20px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 80px 16px 20px 16px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .page-header p {
        font-size: 14px;
    }
    
    .content-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .auth-card {
        padding: 32px 24px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 15px;
        width: 100%;
    }
    
    .alert-info {
        padding: 16px;
    }
    
    .alert-info h3 {
        font-size: 16px;
    }
    
    .alert-info p,
    .alert-info ul {
        font-size: 14px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .icon-option {
        padding: 16px 8px;
    }
    
    .icon-option i {
        font-size: 24px;
    }
    
    .icon-option span {
        font-size: 11px;
    }
    
    .code-block,
    .api-key-box {
        padding: 16px;
        font-size: 12px;
    }
    
    .api-key-box {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .api-key-box .btn {
        width: 100%;
    }
    
    .widget-preview {
        padding: 30px;
    }
    
    .preview-bubble {
        width: 60px;
        height: 60px;
    }
    
    .preview-bubble i {
        font-size: 28px;
    }
}

/* Responsive Small Mobile */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        top: 16px;
        left: 16px;
        padding: 10px 14px;
        font-size: 16px;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .main-content {
        padding: 70px 12px 16px 12px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .page-header {
        margin-bottom: 20px;
    }
    
    .content-card {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px 16px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px 12px;
    }
    
    .btn {
        padding: 10px 16px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .icon-option {
        padding: 12px 6px;
    }
    
    .icon-option i {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .icon-option span {
        font-size: 10px;
    }
    
    .sidebar-header h2 {
        font-size: 20px;
    }
    
    .nav-item {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .code-block,
    .api-key-box {
        padding: 12px;
        font-size: 11px;
        border-radius: 8px;
    }
    
    .widget-preview {
        padding: 20px;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Widget Appearance Styles */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--white);
}

.icon-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.icon-option i {
    font-size: 32px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.icon-option.selected i {
    color: var(--primary);
}

.icon-option span {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

.widget-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 16px;
    margin: 16px 0;
}

.preview-bubble {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, #2b2bff, #8a2be2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s;
}

.preview-bubble:hover {
    transform: scale(1.1);
}

.preview-bubble i {
    font-size: 32px;
}
