/* --- DESIGN SYSTEM & CSS VARIABLES --- */
:root {
    --primary: #0E7490;
    --primary-hover: #164E63;
    --primary-light: #ECFEFF;
    --bg-base: #f1f5f9;
    --bg-surface: rgba(255, 255, 255, 0.4);
    --text-primary: #0F172A;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --border: rgba(255, 255, 255, 0.3);
    --border-top: rgba(255, 255, 255, 0.7);
    --border-light: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(24px);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #0f172a;
        --bg-surface: rgba(15, 23, 42, 0.4);
        --text-primary: #F8FAFC;
        --text-secondary: #94A3B8;
        --text-tertiary: #64748B;
        --border: rgba(255, 255, 255, 0.05);
        --border-top: rgba(255, 255, 255, 0.15);
        --border-light: rgba(255, 255, 255, 0.05);
        --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
        --primary-light: #164E63;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Global Elegant Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 10px; }

/* Global Utilities */
.hidden { display: none !important; }

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-base); 
    color: var(--text-primary); 
    line-height: 1.5; 
    height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    overflow: hidden; 
}

.app-container {
    width: 100%;
    max-width: 768px; 
    height: 100vh; 
    background: transparent; 
    position: relative;
    box-shadow: none; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
}

/* --- 3D GLASS SHAPES --- */
.glass-bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: floatShape 10s infinite ease-in-out alternate;
}
.shape-1 { width: 400px; height: 400px; background: #0E7490; top: -100px; left: -100px; opacity: 0.6; }
.shape-2 { width: 500px; height: 500px; background: #14B8A6; bottom: -150px; right: -150px; opacity: 0.5; animation-delay: -3s; }
.shape-3 { width: 350px; height: 350px; background: #4F46E5; top: 30%; left: 40%; opacity: 0.4; animation-delay: -6s; }

@keyframes floatShape {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-40px) scale(1.1); }
}

/* --- HEADER --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border-top);
    box-shadow: var(--glass-shadow);
    z-index: 10;
}
.logo-container { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.logo-text { font-size: 18px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.logo-subtitle { 
    font-size: 10px; 
    font-weight: 600; 
    color: var(--text-secondary); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    margin-top: 4px;
    animation: premiumPulse 1.5s ease-in-out 3 forwards;
}

@keyframes premiumPulse {
    0% { opacity: 0; transform: scale(0.95); color: var(--text-secondary); }
    30% { opacity: 1; transform: scale(1.05); color: var(--primary); text-shadow: 0 0 10px var(--primary-light); }
    70% { opacity: 1; transform: scale(1.05); color: var(--primary); text-shadow: 0 0 10px var(--primary-light); }
    100% { opacity: 1; transform: scale(1); color: var(--text-secondary); }
}

.header-actions { display: flex; align-items: center; gap: 16px; font-size: 24px; color: var(--text-secondary); cursor: pointer; }
.profile-avatar { width: 32px; height: 32px; background-color: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--primary); }

main#view-container { flex: 1; overflow-y: hidden; position: relative; }
.scroll-content { padding: 20px; height: 100%; overflow-y: auto; padding-bottom: 80px; }

.view {
    display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: transparent; animation: fadeIn var(--transition-normal); flex-direction: column;
}
.view.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- THE INTENT WIZARD --- */
.wizard-hero {
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 32px 24px;
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.wizard-hero h2 { font-size: 28px; font-weight: 800; margin-bottom: 8px; line-height: 1.2; color:white;}
.wizard-hero p { font-size: 15px; margin-bottom: 24px; opacity: 0.9; color:white; }

.search-box {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-pill);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    max-width: 500px;
    margin: 0 auto;
}

.search-box i { font-size: 24px; color: var(--text-tertiary); }
.search-box input {
    border: none; background: transparent; flex: 1;
    font-size: 16px; font-weight: 500; color: var(--text-primary); outline: none;
    font-family: inherit;
}

.suggestion-area { margin-top: 24px; animation: fadeIn 0.3s ease; }
.suggestion-area.hidden { display: none; }
.suggestion-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; opacity: 0.8; }
.primary-suggestion { background: var(--bg-surface) !important; color: var(--text-primary) !important; border: none !important;}

/* --- COMPONENTS --- */
h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; text-align: center; }
.section-container { margin-bottom: 32px; transition: opacity 0.3s ease; }

.primary-button { background-color: var(--primary); color: white; border: none; border-radius: var(--radius-pill); padding: 16px 24px; font-size: 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.secondary-button { background-color: transparent; color: var(--text-primary); border: 2px solid var(--border); border-radius: var(--radius-pill); padding: 14px 24px; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow); }
.primary-button:active, .secondary-button:active { transform: scale(0.98); box-shadow: none; }
.full-width { width: 100%; }

.quick-actions-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.quick-action-chip { background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.quick-action-chip:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow); }
.quick-action-chip:active { transform: scale(0.98); box-shadow: none; }
.quick-action-chip i { font-size: 20px; color: var(--primary); }

.type-cards-list { display: flex; flex-direction: column; gap: 12px; }
.type-card { background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--border); border-top: 1px solid var(--border-top); border-left: 1px solid var(--border-top); border-radius: var(--radius-lg); padding: 16px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: transform var(--transition-fast), box-shadow var(--transition-fast); box-shadow: var(--glass-shadow); }
.type-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 45px 0 rgba(31, 38, 135, 0.25); }
.type-card:active { transform: scale(0.98); box-shadow: none; }
.type-icon { background: var(--primary-light); color: var(--primary); width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.type-info h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.type-info p { font-size: 14px; color: var(--text-secondary); }

/* --- BUILDER --- */
.builder-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 8px; border-bottom: 1px solid var(--border); background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.builder-title h3 { margin: 0; font-size: 16px; }
.progress-text { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.progress-bar-container { height: 4px; background: var(--border); width: 100%; }
.progress-bar-fill { height: 100%; background: var(--primary); width: 33%; transition: width 0.3s ease; }
.builder-content { padding: 24px 20px 100px; }
.builder-footer { position: fixed; bottom: 0; width: 100%; max-width: 768px; background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-top: 1px solid var(--border); padding: 16px 20px; display: flex; gap: 12px; }

.step-guide { margin-bottom: 24px; }
.step-guide h4 { font-size: 20px; font-weight: 700; margin-bottom: 4px;}
.step-guide p { color: var(--text-secondary); font-size: 15px;}

.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.text-input { width: 100%; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); font-size: 16px; font-family: inherit; }
.text-input:focus { outline: none; border-color: var(--primary); }
.color-input { width: 100%; height: 60px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; cursor: pointer; background: var(--bg-base); }
.icon-btn { background: none; border: none; font-size: 24px; color: var(--text-primary); cursor: pointer; padding: 8px; border-radius: 50%; }

/* --- NAVIGATION --- */
.bottom-nav { display: flex; justify-content: space-around; background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-top: 1px solid var(--border); padding: 12px 0; position: fixed; bottom: 0; width: 100%; max-width: 768px; }
.bottom-nav.hidden { display: none; }
.nav-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-tertiary); cursor: pointer; flex: 1; }
.nav-item i { font-size: 24px; }
.nav-item span { font-size: 11px; font-weight: 500; }
.nav-item.active { color: var(--primary); }

/* --- STYLE PICKER --- */
.style-picker-container {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 12px 0 16px;
    margin-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.style-picker-container::-webkit-scrollbar {
    height: 6px;
}
.style-picker-container::-webkit-scrollbar-track {
    background: transparent;
}
.style-picker-container::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}
.style-btn {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}
.style-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

/* --- NOTIFICATIONS --- */
.notification-dropdown { position: absolute; top: 50px; right: 0; width: 300px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 100; overflow: hidden; animation: fadeIn 0.2s ease; }
.notification-dropdown.hidden { display: none; }
.notif-header { padding: 16px; font-weight: 700; border-bottom: 1px solid var(--border); background: var(--bg-base); font-size: 14px; text-align: left;}
.notif-list { max-height: 300px; overflow-y: auto; text-align: left; }
.notif-item { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-light); align-items: flex-start; cursor: pointer; transition: background 0.2s; }
.notif-item:hover { background: var(--bg-base); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.notif-item:not(.unread) .notif-dot { opacity: 0; }
.notif-content h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.notif-content p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* --- LOGIN MODAL --- */
.auth-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.auth-modal.hidden { display: none; }
.auth-modal-content { background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); width: 90%; max-width: 400px; border-radius: var(--radius-xl); padding: 32px 24px; position: relative; box-shadow: var(--shadow-lg); text-align: center; border: 1px solid var(--border); }
.close-modal-btn { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 24px; color: var(--text-tertiary); cursor: pointer; }
.auth-header h3 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.auth-header p { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }
.auth-buttons { display: flex; flex-direction: column; gap: 16px; }
.auth-btn { width: 100%; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; transition: all 0.2s; background: var(--bg-surface); color: var(--text-primary); }
.auth-btn i { font-size: 24px; }
.auth-btn:hover { background: var(--bg-base); border-color: var(--text-tertiary); }
.google-btn i { color: #EA4335; }
.facebook-btn { background: #1877F2; color: white; border: none; }
.facebook-btn i { color: white; }
.facebook-btn:hover { background: #166FE5; border-color: transparent; }

/* --- MY QRS GRID --- */
.qr-history-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.history-card { background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--border); border-top: 1px solid var(--border-top); border-left: 1px solid var(--border-top); border-radius: var(--radius-lg); padding: 16px; text-align: center; position: relative; transition: transform var(--transition-fast), box-shadow var(--transition-fast); box-shadow: var(--glass-shadow); }
.history-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 15px 45px 0 rgba(31, 38, 135, 0.25); }
.history-card:active { transform: scale(0.98); box-shadow: none; }
.history-card img { width: 100%; border-radius: var(--radius-md); margin-bottom: 12px; border: 1px solid var(--border-light); }
.history-card h4 { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.history-card p { font-size: 11px; color: var(--text-tertiary); margin-bottom: 12px; }
.history-card button { background: var(--primary-light); color: var(--primary); border: none; padding: 8px 12px; font-size: 12px; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; width: 100%; transition: all 0.2s; }
.history-card button:hover { background: var(--primary); color: white; }

/* --- TOGGLE SWITCH --- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .3s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* --- MAIN TABS (URL SHORTENER VS QR) --- */
.main-tabs { display: flex; width: 100%; border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; margin-top: 20px; }
.main-tab { flex: 1; padding: 16px; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; border: none; transition: all 0.2s; }
.main-tab i { font-size: 20px; }
.main-tab#tab-shorten.active { background: var(--bg-surface); color: var(--text-primary); }
.main-tab#tab-shorten:not(.active) { background: #0E7490; color: white; opacity: 0.9; }
.main-tab#tab-qr.active { background: var(--bg-surface); color: var(--text-primary); }
.main-tab#tab-qr:not(.active) { background: #0E7490; color: white; opacity: 0.9; }

.home-section { display: none; animation: fadeIn 0.3s ease; }
.home-section.active-section { display: block; }
.shortener-card { background: var(--bg-surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); padding: 32px 24px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); border: 1px solid var(--border); border-top: none; border-left: 1px solid var(--border-top); border-right: 1px solid var(--border-top); border-bottom: 1px solid var(--border-top); box-shadow: var(--glass-shadow); transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
