/* Component Styles */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: modalFadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 85vw;
    max-height: 85vh;
    margin: auto;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    object-fit: contain;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    transition: background-color 0.2s ease;
    z-index: 1001;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Modal Navigation Buttons - matches gallery-nav style */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.25s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.modal-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.modal-nav-prev {
    left: 20px;
}

.modal-nav-next {
    right: 20px;
}

@media (max-width: 768px) {
    .modal-close {
        top: 15px;
        right: 15px;
        position: fixed;
        z-index: 1001;
    }
    
    .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        padding: 60px 10px;
    }
    
    .modal-content img {
        max-height: 75vh;
        border-radius: var(--radius-md);
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
    }
    
    .modal-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .modal-nav-prev {
        left: 10px;
    }
    
    .modal-nav-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .modal-nav {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.9);
    }
    
    .modal-nav-prev {
        left: 8px;
    }
    
    .modal-nav-next {
        right: 8px;
    }
    
    .modal-content img {
        max-height: 70vh;
    }
}

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-sans);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    outline: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-accent-foreground);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: #003d99;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Card Components */
.card {
    background-color: var(--color-card);
    color: var(--color-card-foreground);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

.card-header {
    padding: 1.5rem 1.5rem 0;
}

.card-content {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem;
}

/* Loading States */
.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid var(--color-muted);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Gallery Loading */
.gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--color-muted-foreground);
    font-style: italic;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Grid System */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sm\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-light {
    font-weight: 300;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Spacing Utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }
.m-8 { margin: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Visibility */
.hidden {
    display: none;
}

.visible {
    visibility: visible;
}

.invisible {
    visibility: hidden;
}

/* Responsive Utilities */
@media (min-width: 640px) {
    .sm\:block {
        display: block;
    }
    
    .sm\:hidden {
        display: none;
    }
}

@media (min-width: 768px) {
    .md\:block {
        display: block;
    }
    
    .md\:hidden {
        display: none;
    }
}

@media (min-width: 1024px) {
    .lg\:block {
        display: block;
    }
    
    .lg\:hidden {
        display: none;
    }
}

/* Interactive States */
.interactive {
    cursor: pointer;
    transition: all var(--transition-normal);
}

.interactive:hover {
    transform: translateY(-1px);
}

.interactive:active {
    transform: translateY(0);
}

/* Selection Styles */
::selection {
    background-color: rgba(176, 132, 166, 0.3);
    color: var(--color-foreground);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-muted);
}

::-webkit-scrollbar-thumb {
    background: var(--color-muted-foreground);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}