/* TBC Guild Website - Design System (matches torreybot.com) */

:root {
    --apple-blue: #5794f2;
    --apple-blue-hover: #4e8ae6;
    --apple-green: #73bf69;
    --apple-red: #f2495c;
    --apple-orange: #ff9830;
    --apple-purple: #b877d9;
    --apple-yellow: #fade2a;

    --text-primary: #e6e6e6;
    --text-secondary: #a9a9a9;
    --text-tertiary: #8e8e8e;

    --background-primary: #1f1f23;
    --background-secondary: #2a2a2e;
    --background-tertiary: #323236;

    --border-light: #404040;
    --border-lighter: #383838;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    /* WoW Class Colors */
    --class-warrior: #C79C6E;
    --class-paladin: #F58CBA;
    --class-hunter: #ABD473;
    --class-rogue: #FFF569;
    --class-priest: #FFFFFF;
    --class-shaman: #0070DE;
    --class-mage: #69CCF0;
    --class-warlock: #9482C9;
    --class-druid: #FF7D0A;

    /* Item Quality Colors */
    --quality-poor: #9d9d9d;
    --quality-common: #ffffff;
    --quality-uncommon: #1eff00;
    --quality-rare: #0070dd;
    --quality-epic: #a335ee;
    --quality-legendary: #ff8000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation */
.nav {
    background: var(--background-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

.nav-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--background-tertiary);
}

.nav-link.active {
    color: var(--apple-blue);
    background: rgba(87, 148, 242, 0.1);
}

.nav-external {
    color: var(--apple-orange);
}

.nav-external:hover {
    color: var(--apple-orange);
    background: rgba(255, 152, 48, 0.1);
}

/* Mobile Nav */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--background-secondary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Cards */
.card {
    background: var(--background-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-lighter);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue { background: rgba(87, 148, 242, 0.2); color: var(--apple-blue); }
.badge-green { background: rgba(115, 191, 105, 0.2); color: var(--apple-green); }
.badge-orange { background: rgba(255, 152, 48, 0.2); color: var(--apple-orange); }
.badge-red { background: rgba(242, 73, 92, 0.2); color: var(--apple-red); }
.badge-purple { background: rgba(184, 119, 217, 0.2); color: var(--apple-purple); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--apple-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--apple-blue-hover);
}

.btn-secondary {
    background: var(--background-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-success {
    background: var(--apple-green);
    color: white;
}

.btn-danger {
    background: var(--apple-red);
    color: white;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-lighter);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-primary);
}

tr:hover {
    background: var(--background-tertiary);
}

/* Raid Cards */
.raid-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--background-tertiary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.raid-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--apple-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.raid-info {
    flex: 1;
}

.raid-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.raid-time {
    color: var(--text-secondary);
    font-size: 14px;
}

.raid-signups {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signup-count {
    font-weight: 600;
    color: var(--apple-green);
}

/* Clickable Raid Cards */
.raid-card-link {
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.raid-card-link:hover {
    background: var(--border-light);
    transform: translateX(4px);
}

.raid-arrow {
    color: var(--text-tertiary);
    font-size: 20px;
    transition: transform 0.2s ease;
}

.raid-card-link:hover .raid-arrow {
    color: var(--apple-blue);
    transform: translateX(4px);
}

/* Loot Item */
.loot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-tertiary);
    border-radius: 8px;
    margin-bottom: 8px;
}

.loot-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid var(--quality-epic);
}

.loot-item-name {
    flex: 1;
}

.loot-item-name a {
    color: var(--quality-epic);
    text-decoration: none;
}

.loot-item-name a:hover {
    text-decoration: underline;
}

.loot-winner {
    font-weight: 500;
}

/* Class Colors */
.class-warrior { color: var(--class-warrior); }
.class-paladin { color: var(--class-paladin); }
.class-hunter { color: var(--class-hunter); }
.class-rogue { color: var(--class-rogue); }
.class-priest { color: var(--class-priest); }
.class-shaman { color: var(--class-shaman); }
.class-mage { color: var(--class-mage); }
.class-warlock { color: var(--class-warlock); }
.class-druid { color: var(--class-druid); }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: var(--apple-blue);
    background: rgba(87, 148, 242, 0.05);
}

.upload-area.dragover {
    border-color: var(--apple-green);
    background: rgba(115, 191, 105, 0.1);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Forms */
input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--apple-blue);
}

label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Stats */
.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--apple-blue);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Footer */
.footer {
    background: var(--background-secondary);
    border-top: 1px solid var(--border-light);
    padding: 24px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
    margin-top: auto;
}

.footer a {
    color: var(--apple-blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--apple-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(115, 191, 105, 0.1);
    border: 1px solid var(--apple-green);
    color: var(--apple-green);
}

.alert-error {
    background: rgba(242, 73, 92, 0.1);
    border: 1px solid var(--apple-red);
    color: var(--apple-red);
}

.alert-info {
    background: rgba(87, 148, 242, 0.1);
    border: 1px solid var(--apple-blue);
    color: var(--apple-blue);
}

/* ========================================
   Raid Calendar Styles
   ======================================== */

.raid-calendar {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 16px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.calendar-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-month {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-nav-btn {
    background: var(--background-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: var(--apple-blue);
    color: white;
    border-color: var(--apple-blue);
}

.calendar-today-btn {
    background: var(--apple-blue);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.calendar-grid {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    background: var(--background-tertiary);
    border-radius: 12px;
    min-height: 140px;
    padding: 12px;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: var(--background-secondary);
}

.calendar-today {
    border: 2px solid var(--apple-blue);
    box-shadow: 0 0 20px rgba(87, 148, 242, 0.2);
}

.calendar-past {
    opacity: 0.6;
}

.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.calendar-day-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
}

.calendar-day-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.today-number {
    background: var(--apple-blue);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-content {
    overflow-y: auto;
    max-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-no-raids {
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
}

.calendar-raid {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    border-left: 3px solid;
    text-decoration: none;
    transition: all 0.2s ease;
}

.calendar-raid:hover {
    transform: translateX(4px);
}

.calendar-raid-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.calendar-raid-info {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.calendar-raid-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-raid-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.calendar-raid-signups {
    text-align: right;
    flex-shrink: 0;
}

.calendar-raid-signups .signup-number {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--apple-green);
}

.calendar-raid-signups .signup-label {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Next Raid Card */
.next-raid-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--apple-green);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, transparent 50%);
}

.next-raid-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--apple-green);
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.next-raid-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    text-decoration: none;
}

.next-raid-icon {
    font-size: 48px;
}

.next-raid-info {
    flex: 1;
}

.next-raid-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.next-raid-time {
    font-size: 16px;
    color: var(--apple-blue);
    margin-bottom: 4px;
}

.next-raid-leader {
    font-size: 13px;
    color: var(--text-tertiary);
}

.next-raid-signups {
    text-align: center;
    padding: 16px 24px;
    background: var(--background-tertiary);
    border-radius: 12px;
}

.signup-count-large {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--apple-green);
}

/* Upcoming List */
.upcoming-list {
    display: flex;
    flex-direction: column;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-item:hover {
    background: var(--background-tertiary);
}

.upcoming-icon {
    font-size: 20px;
}

.upcoming-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.upcoming-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.upcoming-signups {
    color: var(--apple-green);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 4px;
}

/* Mobile Responsive Calendar */
@media (max-width: 900px) {
    .calendar-grid {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .calendar-day {
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
        min-height: auto;
        padding: 16px;
    }

    .calendar-day-header {
        flex-direction: row;
    }

    .calendar-day-name {
        font-size: 14px;
    }

    .calendar-day-number {
        font-size: 18px;
    }

    .calendar-no-raids {
        display: none;
    }

    .calendar-day:not(:has(.calendar-raid)) {
        display: none;
    }

    .next-raid-content {
        flex-direction: column;
        text-align: center;
    }

    .next-raid-signups {
        width: 100%;
    }

    .next-raid-badge {
        position: static;
        display: inline-block;
        margin-bottom: 12px;
    }
}
