/* style.css - Premium Flat CSS Design System for Team Mania Pro */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Custom overrides will be output in the header */
    --primary: #10b981;
    --primary-hover: #059669;
    --secondary: #1e293b;
    --secondary-hover: #0f172a;
    
    /* Solid Colors */
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --bg-nav: #0f172a;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #ffffff;
    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header {
    background-color: var(--bg-nav);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 70px;
}

.branding {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-light);
}

.branding img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.branding span {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* Page Layout */
main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 24px;
}

/* Dashboard Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--secondary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #fff;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-light);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: transparent;
}

th, td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

tr:last-child td {
    border-bottom: none;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Chat Styles */
.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 180px);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-rooms-list {
    background-color: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-room-item {
    padding: 10px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.chat-room-item:hover, .chat-room-item.active {
    background-color: #e2e8f0;
}

.chat-messages-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #f8fafc;
}

.chat-msg {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.4;
}

.chat-msg-received {
    align-self: flex-start;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
}

.chat-msg-sent {
    align-self: flex-end;
    background-color: var(--primary);
    color: var(--text-light);
}

.chat-msg-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.chat-msg-sent .chat-msg-meta {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

/* Footer style */
footer {
    background-color: var(--bg-nav);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 20px 24px;
    font-size: 13px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

footer a:hover {
    color: #ffffff !important;
}

/* QR notice block for printable page/downloads */
.qr-notice {
    display: none;
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    align-items: center;
    gap: 20px;
    background-color: #fff;
}

/* Custom CSS Scroll-Snap Carousel styling */
.tm-carousel {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}
.tm-carousel::-webkit-scrollbar {
    height: 6px;
}
.tm-carousel::-webkit-scrollbar-track {
    background: transparent;
}
.tm-carousel::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}


/* Print Overrides */
@media print {
    @page {
        margin: 0;
    }
    body {
        background-color: #fff;
        color: #000;
        margin: 1.6cm; /* Apply custom print margins to page body */
    }
    header, footer, .btn, .chat-input-area, .chat-rooms-list, form, .no-print {
        display: none !important;
    }
    main {
        padding: 0;
    }
    .qr-notice {
        display: flex !important;
    }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .chat-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 240px);
    }
    .chat-rooms-list {
        display: none; /* Can toggle in JS or keep simple */
    }
    .grid,
    .dashboard-grid,
    [style*="display: grid"],
    [style*="display:grid"] {
        grid-template-columns: 1fr !important;
    }
}

/* Dark Theme Variables & Overrides */
body.dark-theme {
    --bg-app: #0b0f19;
    --bg-card: #151f32;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #243249;
    --bg-nav: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

body.dark-theme label,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme .card-title {
    color: #f8fafc !important;
}

body.dark-theme footer {
    background-color: #0f172a !important;
    border-top: 1px solid #243249 !important;
    color: #94a3b8 !important;
}

body.dark-theme footer a {
    color: #94a3b8 !important;
}

body.dark-theme footer a:hover {
    color: #f8fafc !important;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #243249 !important;
}

body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    border-color: var(--primary) !important;
}

body.dark-theme table th {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

body.dark-theme table td {
    color: #f8fafc;
    border-bottom: 1px solid #243249;
}

body.dark-theme table tr:hover {
    background-color: #1e293b !important;
}

body.dark-theme .alert {
    background-color: #1e293b !important;
    border-color: #243249 !important;
    color: #f8fafc !important;
}

body.dark-theme .card {
    background-color: var(--bg-card);
    border: 1px solid #243249;
}

body.dark-theme .card-title {
    color: #f1f5f9;
}

body.dark-theme .btn-secondary {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

body.dark-theme .btn-secondary:hover {
    background-color: #0f172a;
}

/* Hamburger Toggle Button styles */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburger Animations */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        display: none !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-nav);
        padding: 20px;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
        gap: 12px;
    }
    
    .nav-links.open {
        display: flex !important;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 10px;
        width: 100%;
    }
    
    .user-menu {
        display: none !important;
    }
    
    .tm-forum-post {
        grid-template-columns: 1fr !important;
    }
    .tm-forum-post-author {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-right: 0 !important;
        padding-bottom: 15px !important;
    }
}

/* Quill Editor Styling Override */
.ql-toolbar.ql-snow {
    background-color: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color) !important;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}
.ql-container.ql-snow {
    background-color: var(--bg-app, #ffffff);
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
}
.ql-editor {
    min-height: 120px;
    color: var(--text-main) !important;
}
.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    font-style: normal;
}
/* Toolbar button colors in dark theme */
body.dark-theme .ql-snow .ql-stroke {
    stroke: var(--text-main) !important;
}
body.dark-theme .ql-snow .ql-fill {
    fill: var(--text-main) !important;
}
body.dark-theme .ql-snow .ql-picker {
    color: var(--text-main) !important;
}
body.dark-theme .ql-snow .ql-picker-options {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}
body.dark-theme .ql-snow.ql-toolbar button:hover,
body.dark-theme .ql-snow .ql-toolbar button:hover,
body.dark-theme .ql-snow.ql-toolbar button.ql-active,
body.dark-theme .ql-snow .ql-toolbar button.ql-active,
body.dark-theme .ql-snow.ql-toolbar .ql-picker-label:hover,
body.dark-theme .ql-snow .ql-toolbar .ql-picker-label:hover,
body.dark-theme .ql-snow.ql-toolbar .ql-picker-label.ql-active,
body.dark-theme .ql-snow .ql-toolbar .ql-picker-label.ql-active {
    color: var(--primary) !important;
}
body.dark-theme .ql-snow.ql-toolbar button:hover .ql-stroke,
body.dark-theme .ql-snow .ql-toolbar button:hover .ql-stroke,
body.dark-theme .ql-snow.ql-toolbar button.ql-active .ql-stroke,
body.dark-theme .ql-snow .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--primary) !important;
}
body.dark-theme .ql-snow.ql-toolbar button:hover .ql-fill,
body.dark-theme .ql-snow .ql-toolbar button:hover .ql-fill,
body.dark-theme .ql-snow.ql-toolbar button.ql-active .ql-fill,
body.dark-theme .ql-snow .ql-toolbar button.ql-active .ql-fill {
    fill: var(--primary) !important;
}


