/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    background: var(--surface-color);
    width: 90%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 2001;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .modal-content {
        grid-template-columns: 1.5fr 1fr;
    }
}

.modal-media {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.modal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.modal-title {
    font-size: 2rem;
    margin-bottom: 16px;
    font-family: var(--font-display);
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.modal-tags span {
    font-size: 0.8rem;
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
}

.modal-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    flex-grow: 1;
}

.btn-view-project {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding: 0;
}