/* =============================================
   KALENDARZ - STYLES
   ============================================= */
:root {
    --primary-color: #d35400;
    --secondary-color: #ff9900;
    --text-color: #2b2b2b;
    --bg-color: #fffaf6;
    --section-bg: #fff3e6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s ease;
}

body[data-theme="dark"] {
    --primary-color: #b03a2e;
    --secondary-color: #ff9900;
    --text-color: #f3f0ec;
    --bg-color: #0f0f0f;
    --section-bg: #1a1210;
    --card-bg: rgba(26, 18, 16, 0.95);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #fffaf6 0%, #ffe8d6 50%, #ffd4b0 100%);
    background-attachment: fixed;
    transition: background-color var(--transition), color var(--transition);
    min-height: 100vh;
}

body[data-theme="dark"] {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0f0a 50%, #2a1510 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(211, 84, 0, 0.02) 35px, rgba(211, 84, 0, 0.02) 70px);
    pointer-events: none;
    z-index: -1;
}

body[data-theme="dark"]::before {
    background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255, 153, 0, 0.03) 35px, rgba(255, 153, 0, 0.03) 70px);
}

/* --- MINI NAV --- */
.mini-nav {
    background: linear-gradient(135deg, rgba(211, 84, 0, 0.98) 0%, rgba(176, 58, 46, 0.98) 100%);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body[data-theme="dark"] .mini-nav {
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.98) 0%, rgba(42, 21, 16, 0.98) 100%);
}

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

.mini-nav .nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity var(--transition);
}

.mini-nav .nav-links a:hover { opacity: 0.8; }

#theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(20deg) scale(1.1);
}

body[data-theme="dark"] #theme-toggle {
    background: rgba(255, 153, 0, 0.15);
    border-color: rgba(255, 153, 0, 0.4);
    color: #ff9900;
}

/* --- HEADER --- */
header {
    background: linear-gradient(135deg, rgba(211, 84, 0, 0.95) 0%, rgba(176, 58, 46, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 2.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

body[data-theme="dark"] header {
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.95) 0%, rgba(42, 21, 16, 0.95) 100%);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

/* --- MAIN --- */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* --- CALENDAR PUBLIC WRAP --- */
.calendar-public-wrap {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.calendar-public-left { flex: 1 1 0; min-width: 0; }
.calendar-public-right { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1.2rem; }

/* --- CALENDAR CONTROLS --- */
.cal-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.cal-controls h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    min-width: 200px;
    text-align: center;
}

.cal-controls button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.cal-controls button:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

body[data-theme="dark"] .cal-controls button {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

body[data-theme="dark"] .cal-controls button:hover {
    background: var(--secondary-color);
    color: #000;
}

/* --- WEEKDAYS --- */
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.cal-weekday {
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--secondary-color);
    padding: 6px 0;
}

/* --- CALENDAR GRID --- */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-day {
    aspect-ratio: 1 / 1;
    background: var(--card-bg);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 64px;
}

.cal-day.empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.cal-day:not(.empty):hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-color);
}

.cal-day.today {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

.cal-day.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(211, 84, 0, 0.08), rgba(255, 153, 0, 0.08));
}

body[data-theme="dark"] .cal-day {
    background: #1a1210;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .cal-day.selected {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.1), rgba(211, 84, 0, 0.1));
}

.cal-day-num {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-color);
}

.cal-day.has-events .cal-day-num {
    color: var(--primary-color);
}

.cal-day-events {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.cal-event-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--secondary-color);
    box-shadow: 0 0 6px rgba(255, 153, 0, 0.5);
}

.cal-event-count {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--secondary-color);
    background: rgba(255, 153, 0, 0.15);
    border-radius: 10px;
    padding: 0 5px;
}

/* --- DETAILS PANEL --- */
.cal-details-panel {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    display: none;
    border: 1px solid rgba(211, 84, 0, 0.1);
}

.cal-details-panel.active { display: block; }

body[data-theme="dark"] .cal-details-panel {
    background: #1a1210;
    border-color: rgba(255, 153, 0, 0.15);
}

.cal-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cal-details-header h4 {
    color: var(--primary-color);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body[data-theme="dark"] .cal-details-header h4 { color: var(--secondary-color); }

#cal-details-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition);
    padding: 0.3rem;
}

#cal-details-close:hover { opacity: 1; }

.cal-details-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-color);
    opacity: 0.6;
}

.cal-details-empty i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }

/* --- CONVOY CARD --- */
.cal-convoy-card {
    background: var(--section-bg);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-left: 4px solid var(--secondary-color);
}

body[data-theme="dark"] .cal-convoy-card {
    background: rgba(34, 24, 20, 0.95);
}

.cal-convoy-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.cal-convoy-top h5 {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 700;
}

body[data-theme="dark"] .cal-convoy-top h5 { color: var(--secondary-color); }

.cal-convoy-server {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

.cal-convoy-route {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.cal-arrow { color: var(--secondary-color); font-weight: 800; }

.cal-convoy-times {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.cal-convoy-times strong { color: var(--primary-color); }

.cal-convoy-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.cal-convoy-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.cal-link.discord { background: rgba(88, 101, 242, 0.15); color: #5865F2; }
.cal-link.map { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.cal-link.tmp { background: rgba(255, 153, 0, 0.15); color: var(--secondary-color); }

.cal-link:hover { transform: translateY(-2px); filter: brightness(0.9); }

/* --- UPCOMING PANEL --- */
.cal-upcoming-panel {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(211, 84, 0, 0.08);
}

body[data-theme="dark"] .cal-upcoming-panel {
    background: #1a1210;
    border-color: rgba(255, 153, 0, 0.15);
}

.cal-upcoming-panel h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body[data-theme="dark"] .cal-upcoming-panel h4 { color: var(--secondary-color); }

.cal-upcoming-empty {
    color: var(--text-color);
    opacity: 0.6;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

.cal-upcoming-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 0.5rem;
}

.cal-upcoming-item:hover {
    background: var(--section-bg);
    transform: translateX(4px);
}

.cal-upcoming-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 8px;
    padding: 0.3rem 0.5rem;
    flex-shrink: 0;
}

.cal-up-day { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.cal-up-month { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; opacity: 0.9; }

.cal-up-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.cal-up-info strong {
    color: var(--text-color);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-up-info span {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* --- FOOTER --- */
footer {
    background: linear-gradient(135deg, rgba(211, 84, 0, 0.98) 0%, rgba(176, 58, 46, 0.98) 100%);
    color: white;
    text-align: center;
    padding: 20px;
    position: relative;
}

body[data-theme="dark"] footer {
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.98) 0%, rgba(42, 21, 16, 0.98) 100%);
    border-top: 1px solid rgba(255, 153, 0, 0.1);
}

.footer-bottom { font-size: 0.85rem; opacity: 0.9; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .calendar-public-wrap { flex-direction: column; }
    .calendar-public-right { width: 100%; }
    .cal-grid { gap: 4px; }
    .cal-day { min-height: 52px; }
    .cal-day-num { font-size: 0.85rem; }
}

@media (max-width: 600px) {
    header h1 { font-size: 1.6rem; }
    main { padding: 1.2rem 1rem 3rem; }
    .cal-controls h3 { font-size: 1.1rem; min-width: auto; }
    .cal-controls button { width: 36px; height: 36px; }
}
