/* =====================================================================
   Awaz Rajasthan Ki — Core Design System & Styling
   Vanilla CSS3 - Premium Light Saffron & Terracotta Themes
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Tokens */
    --bg-main: #f8fafc;          /* Light Slate 50 */
    --bg-card: #ffffff;          /* Pure White */
    --bg-card-hover: #f1f5f9;    /* Light Slate 100 */
    --border-color: #e2e8f0;     /* Light Slate 200 */
    --border-focus: var(--accent-color);
    
    /* Branding Accent: Warm Terracotta/Saffron of Rajasthan */
    --accent-color: #e05a26;     /* Deep Saffron/Terracotta */
    --accent-hover: #c84617;
    --accent-glow: rgba(224, 90, 38, 0.12);
    
    /* Typography */
    --text-primary: #0f172a;     /* Slate 900 */
    --text-secondary: #475569;   /* Slate 600 */
    --text-muted: #64748b;       /* Slate 500 */
    
    /* Status Colors */
    --color-online: #10b981;     /* Emerald 500 */
    --color-offline: #94a3b8;    /* Slate 400 */
    --color-warning: #d97706;    /* Dark Amber 600 */
    --color-danger: #dc2626;     /* Dark Red 600 */
    
    /* Layout Variables */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --border-radius-lg: 16px;
    --border-radius-md: 8px;
    --sidebar-width: 340px;
    --header-height: 70px;
}

/* 1. Global Reset & Body */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(224, 90, 38, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(241, 245, 249, 0.5) 0px, var(--bg-main) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* 2. Scrollbar customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* 3. Auth Layout (Login Page) */
.auth-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 50% -20%, rgba(224, 90, 38, 0.1), transparent 70%);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.02);
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0f172a 30%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 4. Interactive Forms Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: #ffffff;
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Utility alert boxes */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
    border: 1px solid transparent;
}

.alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
    animation: shake 0.3s ease-in-out;
}

/* 5. Keyframe Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =====================================================================
   Phase 4: Shared File Bubbles, Download Actions & Progress Bar.file-bubble-details {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    margin-top: 8px;
    width: 100%;
    min-width: 250px;
}

.message-bubble.outgoing .file-bubble-details {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.1);
}

.file-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-md);
    background: rgba(224, 90, 38, 0.15);
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.message-bubble.outgoing .file-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.file-meta-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.file-name-text {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.message-bubble.outgoing .file-name-text {
    color: #ffffff;
}

.file-size-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.message-bubble.outgoing .file-size-text {
    color: rgba(255, 255, 255, 0.8);
}

.btn-download {
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(224, 90, 38, 0.15);
}

.btn-download:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.message-bubble.outgoing .btn-download {
    background: #ffffff;
    color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-bubble.outgoing .btn-download:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Upload progress layout */
.upload-progress-card {
    background: #f8fafc;
    border: 1px dashed var(--accent-color);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    width: 100%;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
}

.progress-track {
    background: rgba(0, 0, 0, 0.08);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: var(--accent-color);
    height: 100%;
    width: 0%;
    transition: width 0.25s linear;
}

.progress-status-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* =====================================================================
   Phase 5: File Pinning (is_important) & Countdown Badges
   ===================================================================== */

/* Dynamic Countdown Chip styles */
.countdown-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
    border: 1px solid transparent;
}

.countdown-normal {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--text-secondary);
}

.message-bubble.outgoing .countdown-normal {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.countdown-warning {
    background: #fef3c7; /* Amber 100 */
    border-color: #fde68a; /* Amber 200 */
    color: #b45309; /* Amber 700 */
}

.countdown-danger {
    background: #fee2e2; /* Red 100 */
    border-color: #fca5a5; /* Red 200 */
    color: #dc2626; /* Red 600 */
}

/* Star/Pin Button Styling */
.star-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
    margin-left: 8px;
}

.message-bubble.outgoing .star-btn {
    color: rgba(255, 255, 255, 0.45);
}

.star-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-warning);
}

.message-bubble.outgoing .star-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffe066;
}

.star-btn.starred {
    color: var(--color-warning) !important;
    animation: pulse-star 0.3s ease;
}

.message-bubble.outgoing .star-btn.starred {
    color: #ffe066 !important;
}

@keyframes pulse-star {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Tooltip message container */
.star-container {
    position: relative;
    display: flex;
    align-items: center;
}

.star-tooltip {
    visibility: hidden;
    background: #1e293b;
    color: #f8fafc;
    text-align: center;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: var(--border-radius-md);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 220px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.star-container:hover .star-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -4px);
}
}
