/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--black);
    border: 2px solid var(--gold);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s var(--animation-timing), opacity 0.4s ease;
    animation: borderGlow 2s infinite;
}

.modal-overlay.active .modal {
    transform: translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-header h3 {
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.modal-body {
    margin-bottom: 1.5rem;
}

/* Timeline blocks container with scroll */
.timeline-blocks {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 1.5rem;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--gold) rgba(255, 255, 255, 0.1);
}

/* Webkit scrollbar styling */
.timeline-blocks::-webkit-scrollbar {
    width: 6px;
}

.timeline-blocks::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.timeline-blocks::-webkit-scrollbar-thumb {
    background-color: var(--gold);
    border-radius: 3px;
}

/* Timeline block styling */
.timeline-block {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.timeline-block:hover {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.timeline-icon {
    color: var(--gold);
    flex-shrink: 0;
}

.timeline-content {
    flex-grow: 1;
}

.timeline-time {
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-activity {
    color: var(--text-primary);
}

.modal-form .form-group {
    margin-bottom: 1.5rem;
}

.modal-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    transition: var(--transition);
}

.modal-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.modal-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.modal-form .form-message {
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
    min-height: 24px;
}

.modal-form .error-message {
    color: #ff4d4d;
}

.modal-form .success-message {
    color: #4dff4d;
}

.modal-form input.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal {
        padding: 1.5rem;
    }
    
    .modal-header h3 {
        font-size: 1.5rem;
    }
}