/* CSS Design System for CloudClip */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-dark: #090a0f;
    --bg-card: rgba(18, 20, 29, 0.6);
    --bg-card-hover: rgba(28, 31, 46, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-glow: rgba(99, 102, 241, 0.3);
    
    --primary: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #06b6d4; /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.4);
    --accent: #ec4899; /* Pink */
    --accent-glow: rgba(236, 72, 153, 0.4);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #4b5563;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Glassmorphism Settings */
    --backdrop-blur: blur(12px);
    --box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Navigation / Layout */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(9, 10, 15, 0.6);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--secondary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Outfit', serif;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    -webkit-text-fill-color: initial !important;
}

.nav-brand svg {
    stroke: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Main Container Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Card Styling (Glassmorphism) */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-color-glow);
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.08);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 8px;
    width: 36px;
    height: 36px;
}

/* Inputs & Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.input-field:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Toasts / Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: rgba(18, 20, 29, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    box-shadow: var(--box-shadow);
    backdrop-filter: var(--backdrop-blur);
    animation: slideIn 0.3s var(--transition-bounce) forwards;
    min-width: 250px;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-info { border-left: 4px solid var(--primary); }
.toast-error { border-left: 4px solid var(--danger); }

/* Animations */
@keyframes slideIn {
    from {
        transform: translateY(20px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 15px 4px rgba(99, 102, 241, 0.6);
    }
}

/* Landing/Auth Portal Styling */
.auth-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-fast);
}

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

/* Dashboard Core Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.main-workspace {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Clip Composer */
.composer-card {
    padding: 1.5rem;
}

.composer-textarea {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
    resize: none;
    font-size: 1rem;
    line-height: 1.5;
    transition: var(--transition-fast);
    margin-bottom: 1rem;
}

.composer-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.composer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.custom-select {
    position: relative;
}

.custom-select select {
    appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

select option {
    background-color: #12141d;
    color: #f3f4f6;
}

/* Clipboard Sync Feed */
.clips-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.clips-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.clip-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.clip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.clip-card.public::before { background: var(--secondary); }
.clip-card.shared::before { background: var(--accent); }
.clip-card.encrypted::before { background: var(--warning); }

.clip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.clip-meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clip-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-private { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.badge-public { background: rgba(6, 182, 212, 0.15); color: var(--secondary); }
.badge-shared { background: rgba(236, 72, 153, 0.15); color: var(--accent); }
.badge-encrypted { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.clip-body {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

.clip-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

/* Active Devices / Status Panel */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.panel-card {
    padding: 1.5rem;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.device-item.current {
    border-color: var(--primary-glow);
    background: rgba(99, 102, 241, 0.05);
}

.device-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.device-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.device-item.current .device-icon-container {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.device-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.device-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.device-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

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

.modal-content {
    background: #11131c;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    animation: slideIn 0.3s var(--transition-bounce) forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

/* History Page Styling */
.history-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    justify-content: space-between;
}

.search-bar-container {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-bar-container svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    padding-left: 2.75rem;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* Code Highlighting Block */
.code-container {
    position: relative;
    margin: 0.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    background: #0f1015;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-body {
    padding: 0.75rem;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #e5c76b; /* Code yellow/orange */
}

/* URL Preview Card */
.url-preview {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
    overflow: hidden;
    transition: var(--transition-fast);
}

.url-preview:hover {
    background: rgba(255, 255, 255, 0.04);
}

.url-preview-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.url-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
}

.url-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.url-domain {
    font-size: 0.7rem;
    color: var(--text-dark);
}

/* Toggle Switch */
.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* Ping shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-ping {
    animation: shake 0.5s ease-in-out;
}



/* Quick Filter Pills Bar */
.filter-pills-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    scrollbar-width: none;
}
.filter-pills-bar::-webkit-scrollbar {
    display: none;
}
.filter-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}
.filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}
.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 8px 0 var(--primary-glow);
}

/* Real-Time Analytics Drawer Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}
.analytics-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.analytics-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}
.analytics-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sound mixer settings styles */
.sound-mixer-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}
.sound-select {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.85rem;
}
.volume-slider {
    width: 100px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Responsive Enhancements for Smart Devices and Varying Screen Sizes */

/* Tablets / iPads (max-width: 768px) */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }
    
    .nav-brand {
        font-size: 1.25rem;
    }
    
    .nav-links {
        gap: 0.75rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    
    .container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar-container {
        width: 100%;
    }
    
    .filter-group {
        width: 100%;
        justify-content: flex-start;
    }
    
    .filter-group select, .filter-group button {
        flex: 1;
        text-align: center;
    }
}

/* Mobile Devices / iPhones / Androids (max-width: 480px) */
@media (max-width: 480px) {
    nav {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
    
    .container {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }
    
    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }
    
    .auth-header h2 {
        font-size: 1.6rem;
    }
    
    .composer-card {
        padding: 1rem;
    }
    
    .composer-textarea {
        height: 140px;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .composer-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .toolbar-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .custom-select {
        flex: 1;
    }
    
    .custom-select select {
        width: 100%;
        text-align: center;
    }
    
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
    
    #sync-clip-btn {
        width: 100%;
        justify-content: center;
    }
    
    .clips-feed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .clips-feed-header h3 {
        font-size: 1.1rem;
    }
    
    .clip-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .clip-actions {
        justify-content: space-between;
        gap: 0.25rem;
    }
    
    .clip-actions button {
        flex: 1;
        font-size: 0.8rem;
        padding: 0.4rem;
        justify-content: center;
    }
    
    .side-panel {
        gap: 1rem;
    }
    
    .panel-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .analytics-card {
        padding: 0.6rem;
    }
    
    .analytics-value {
        font-size: 1.1rem;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Extra Small Devices (max-width: 320px) */
@media (max-width: 320px) {
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Dropdown Navigation Menu & Spinner Styles */
@media (max-width: 480px) {
    .nav-links > a, 
    .nav-links > .btn {
        display: none !important;
    }
    #mobile-profile-menu-btn {
        display: inline-flex !important;
    }
}

.mobile-dropdown-menu {
    display: none;
    flex-direction: column;
}

.mobile-dropdown-item {
    display: block;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: 0.2s ease;
    text-align: left;
    font-weight: 500;
}

.mobile-dropdown-item:hover, 
.mobile-dropdown-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.mobile-dropdown-action {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s ease;
    font-family: inherit;
    font-weight: 500;
}

.mobile-dropdown-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optimization for Samsung Galaxy A16 (390px - 395px Viewport width) */
@media (min-width: 375px) and (max-width: 405px) {
    .analytics-grid {
        grid-template-columns: 1fr !important;
    }
    .composer-card {
        padding: 0.85rem !important;
    }
    .container {
        padding: 0 0.5rem !important;
        margin: 0.75rem auto !important;
    }
    .modal-content {
        width: calc(100% - 1rem) !important;
        margin: 0.5rem !important;
        padding: 1rem !important;
    }
    .nav-links {
        gap: 0.35rem !important;
    }
    textarea.input-field {
        height: 100px !important;
    }
    .clip-actions {
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
    }
    .clip-actions button {
        flex: 1 1 45% !important;
        font-size: 0.75rem !important;
        padding: 0.35rem !important;
    }
    /* Inserts wrapping for settings flex buttons */
    .form-group div[style*="display: flex; gap: 0.5rem;"],
    .form-group div[style*="display:flex; gap:0.5rem;"] {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .form-group div[style*="display: flex; gap: 0.5rem;"] button,
    .form-group div[style*="display:flex; gap:0.5rem;"] button {
        width: 100% !important;
        padding: 0.5rem !important;
    }
}
