/* RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%);
    color: #2c3e50;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* HEADER */
header {
    background: linear-gradient(90deg, #3498db, #2c3e50);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.logo i {
    font-size: 32px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    font-size: 18px;
    opacity: 0.9;
}

/* LAYOUT */
.content {
    display: flex;
    min-height: 500px;
}

.sidebar {
    width: 300px;
    background: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #eaeaea;
}

.main {
    flex: 1;
    padding: 20px;
}

/* STATUS BOX */
.user-status {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.premium-badge {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: #333;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    margin-top: 5px;
}

/* FORM */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

textarea {
    height: 80px;
    resize: vertical;
}

button {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    width: 100%;
    margin-top: 5px;
}

button:hover {
    background: #2980b9;
}

/* Add Event Button Specific */
#add-event-btn {
    background: #27ae60 !important;
    color: white !important;
    font-size: 14px !important;
    margin-top: 10px !important;
}

#add-event-btn:hover {
    background: #219653 !important;
}

/* PREMIUM LOCK */
.premium-feature {
    opacity: 0.6;
    position: relative;
}

.premium-feature::after {
    content: "Premium Feature";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.9);
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 12px;
}

/* ENHANCED TIMELINE STYLING */
.timeline-container {
    position: relative;
    margin: 30px 0;
    padding: 40px 0;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 8px;
    background: linear-gradient(180deg, #3498db, #2980b9);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -4px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.timeline-event {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    margin-bottom: 30px;
}

.timeline-event::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 5px solid #fff;
    border-radius: 50%;
    top: 30px;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.left {
    left: 0;
}

.left::after {
    right: -16px;
}

.right {
    left: 50%;
}

.right::after {
    left: -16px;
}

/* ENHANCED EVENT CONTENT WITH BLUE BORDERS & SHADOWS */
.event-content {
    padding: 25px;
    border-radius: 15px;
    position: relative;
    /* Enhanced shadow for more depth */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12),
        0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* Hover effect for cards */
.event-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18),
        0 8px 20px rgba(0, 0, 0, 0.12);
}

/* ALTERNATING BACKGROUNDS WITH BLUE BORDERS - CORRECTED SIDES */
.timeline-event:nth-child(odd) .event-content {
    background: linear-gradient(145deg, #f8f9fa, #f1f3f4);
    border: 1px solid #e9ecef;
    /* Blue border on the LEFT side for LEFT cards (closer to flagpost) */
    border-left: 5px solid #3498db;
}

.timeline-event:nth-child(even) .event-content {
    background: linear-gradient(145deg, #f0fdfa, #e6fffa);
    border: 1px solid #d1fae5;
    /* Blue border on the RIGHT side for RIGHT cards (closer to flagpost) */
    border-right: 5px solid #3498db;
}

/* Enhanced blue border glow effect - CORRECTED SIDES */
.timeline-event:nth-child(odd) .event-content {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12),
        0 4px 15px rgba(0, 0, 0, 0.08),
        -3px 0 8px rgba(52, 152, 219, 0.15);
    /* Blue glow on left */
}

.timeline-event:nth-child(even) .event-content {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12),
        0 4px 15px rgba(0, 0, 0, 0.08),
        3px 0 8px rgba(52, 152, 219, 0.15);
    /* Blue glow on right */
}

/* Arrow Connectors - Enhanced with subtle blue tint */
.event-content::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    top: 30px;
    border: 15px solid transparent;
    filter: drop-shadow(2px 0 4px rgba(52, 152, 219, 0.1));
}

.left .event-content::before {
    right: -30px;
}

.right .event-content::before {
    left: -30px;
}

/* Alternating Arrow Colors with subtle blue enhancement */
.timeline-event:nth-child(odd) .event-content::before {
    border-left-color: #f8f9fa;
}

.timeline-event:nth-child(even) .event-content::before {
    border-right-color: #f0fdfa;
}

.timeline-event:nth-child(odd).right .event-content::before {
    border-right-color: #f8f9fa;
    border-left-color: transparent;
}

.timeline-event:nth-child(even).left .event-content::before {
    border-left-color: #f0fdfa;
    border-right-color: transparent;
}

/* Enhanced text styling with better contrast */
.event-date {
    font-weight: 700;
    color: #2980b9;
    /* Slightly deeper blue */
    margin-bottom: 8px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.event-title {
    font-weight: 800;
    margin-bottom: 12px;
    font-size: 22px;
    color: #2c3e50;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.event-description {
    color: #5a6c7d;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* ACTIONS */
.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn-export {
    background: #27ae60;
}

.btn-export:hover {
    background: #219653;
}

.btn-clear {
    background: #e74c3c;
}

.btn-clear:hover {
    background: #c0392b;
}

.upgrade-cta {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: #333;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: 600;
}

/* Footer Link Styling */
footer {
    text-align: center;
    padding: 20px;
    background: #2c3e50;
    color: #fff;
    font-size: 14px;
}

.footer-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* CUSTOM MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-header i {
    font-size: 24px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-body p {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #2c3e50;
    line-height: 1.5;
}

.modal-warning {
    font-size: 14px !important;
    color: #e74c3c !important;
    font-weight: 500;
    background: #fdf2f2;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.modal-actions {
    padding: 0 25px 25px 25px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
}

.btn-confirm {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced PDF Export Styles */
@media print {
    .timeline-container {
        background: white;
        padding: 30px;
    }

    .timeline-event {
        page-break-inside: avoid;
        margin-bottom: 30px;
    }

    .event-content {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }

    /* Ensure alternating backgrounds and blue borders show in print - CORRECTED */
    .timeline-event:nth-child(odd) .event-content {
        background: #f8f9fa !important;
        border-left: 5px solid #3498db !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    .timeline-event:nth-child(even) .event-content {
        background: #f0fdfa !important;
        border-right: 5px solid #3498db !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-event {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-event::after {
        left: 18px;
    }

    .left,
    .right {
        left: 0;
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-confirm {
        flex: none;
    }

    /* Mobile: All arrows point right, all blue borders on left side */
    .timeline-event:nth-child(odd) .event-content::before,
    .timeline-event:nth-child(even) .event-content::before {
        border-right-color: transparent;
    }

    .timeline-event:nth-child(odd) .event-content::before {
        border-left-color: #f8f9fa;
    }

    .timeline-event:nth-child(even) .event-content::before {
        border-left-color: #f0fdfa;
    }

    /* Mobile: All cards get left blue border (closer to flagpost) */
    .timeline-event:nth-child(odd) .event-content {
        border-left: 5px solid #3498db !important;
        border-right: 1px solid #e9ecef !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12),
            0 4px 15px rgba(0, 0, 0, 0.08),
            -3px 0 8px rgba(52, 152, 219, 0.15) !important;
    }

    .timeline-event:nth-child(even) .event-content {
        border-left: 5px solid #3498db !important;
        border-right: 1px solid #d1fae5 !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12),
            0 4px 15px rgba(0, 0, 0, 0.08),
            -3px 0 8px rgba(52, 152, 219, 0.15) !important;
    }

    /* Footer Link Styling - ENHANCED */
    footer {
        text-align: center;
        padding: 20px;
        background: #2c3e50;
        color: #fff;
        font-size: 14px;
    }

    .footer-link {
        color: #3498db !important;
        text-decoration: underline !important;
        font-weight: 600;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .footer-link:hover {
        color: #2980b9 !important;
        text-decoration: underline !important;
        text-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    }