/**
 * Art Discovery Explorer - Styles
 * An interactive gallery browser for the Art Institute of Chicago
 */

/* ======================================
   CSS Variables
   ====================================== */
:root {
    --ade-primary: #b50938;
    --ade-primary-hover: #8a0729;
    --ade-secondary: #282828;
    --ade-accent: #f0e6d3;
    --ade-text: #333333;
    --ade-text-light: #666666;
    --ade-border: #e0e0e0;
    --ade-background: #fafafa;
    --ade-white: #ffffff;
    --ade-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --ade-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --ade-radius: 8px;
    --ade-radius-lg: 12px;
    --ade-transition: 0.3s ease;
}

/* ======================================
   Container
   ====================================== */
.ade-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ======================================
   Controls Section
   ====================================== */
.ade-controls {
    background: var(--ade-white);
    border-radius: var(--ade-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--ade-shadow);
}

.ade-search-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.ade-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--ade-border);
    border-radius: var(--ade-radius);
    transition: border-color var(--ade-transition);
}

.ade-search-input:focus {
    outline: none;
    border-color: var(--ade-primary);
}

/* ======================================
   Buttons
   ====================================== */
.ade-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--ade-radius);
    cursor: pointer;
    transition: all var(--ade-transition);
}

.ade-btn-primary {
    background: var(--ade-primary);
    color: var(--ade-white);
}

.ade-btn-primary:hover {
    background: var(--ade-primary-hover);
    transform: translateY(-1px);
}

.ade-btn-secondary {
    background: var(--ade-secondary);
    color: var(--ade-white);
}

.ade-btn-secondary:hover {
    background: #1a1a1a;
}

.ade-btn-surprise {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--ade-white);
    font-size: 15px;
}

.ade-btn-surprise:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ade-surprise-icon {
    font-size: 18px;
    animation: ade-shake 2s ease-in-out infinite;
}

@keyframes ade-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.ade-btn-surprise:hover .ade-surprise-icon {
    animation: ade-roll 0.5s ease;
}

@keyframes ade-roll {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ======================================
   Filters
   ====================================== */
.ade-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.ade-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ade-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ade-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ade-filter-select {
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid var(--ade-border);
    border-radius: var(--ade-radius);
    background: var(--ade-white);
    cursor: pointer;
    transition: border-color var(--ade-transition);
}

.ade-filter-select:focus {
    outline: none;
    border-color: var(--ade-primary);
}

.ade-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ade-date-range input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid var(--ade-border);
    border-radius: var(--ade-radius);
    max-width: 100px;
}

.ade-date-range input:focus {
    outline: none;
    border-color: var(--ade-primary);
}

.ade-filter-checkboxes {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.ade-filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    cursor: pointer;
}

.ade-filter-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ade-primary);
}

/* ======================================
   Actions Bar
   ====================================== */
.ade-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.ade-view-toggle {
    display: flex;
    margin-left: auto;
    border: 2px solid var(--ade-border);
    border-radius: var(--ade-radius);
    overflow: hidden;
}

.ade-view-btn {
    padding: 8px 12px;
    background: var(--ade-white);
    border: none;
    cursor: pointer;
    transition: all var(--ade-transition);
}

.ade-view-btn:hover {
    background: var(--ade-background);
}

.ade-view-btn.active {
    background: var(--ade-primary);
    color: var(--ade-white);
}

.ade-view-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ======================================
   Results Info
   ====================================== */
.ade-results-info {
    padding: 12px 0;
    font-size: 14px;
    color: var(--ade-text-light);
}

/* ======================================
   Gallery Grid
   ====================================== */
.ade-gallery {
    display: grid;
    gap: 24px;
    min-height: 400px;
}

.ade-gallery.ade-view-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ade-gallery.ade-view-list {
    grid-template-columns: 1fr;
}

/* ======================================
   Artwork Card
   ====================================== */
.ade-artwork-card {
    background: var(--ade-white);
    border-radius: var(--ade-radius-lg);
    overflow: hidden;
    box-shadow: var(--ade-shadow);
    transition: all var(--ade-transition);
    cursor: pointer;
}

.ade-artwork-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ade-shadow-lg);
}

.ade-view-list .ade-artwork-card {
    display: grid;
    grid-template-columns: 200px 1fr;
}

.ade-artwork-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--ade-accent);
}

.ade-view-list .ade-artwork-image-wrapper {
    aspect-ratio: auto;
    height: 200px;
}

.ade-artwork-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ade-transition);
}

.ade-artwork-card:hover .ade-artwork-image {
    transform: scale(1.05);
}

.ade-artwork-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ade-accent) 0%, #e0d5c4 100%);
    color: var(--ade-text-light);
    font-size: 14px;
}

.ade-artwork-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ade-badge {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ade-text);
}

.ade-badge-public {
    background: rgba(34, 139, 34, 0.9);
    color: var(--ade-white);
}

.ade-badge-on-view {
    background: rgba(181, 9, 56, 0.9);
    color: var(--ade-white);
}

.ade-artwork-info {
    padding: 16px;
}

.ade-artwork-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ade-text);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ade-artwork-artist {
    font-size: 14px;
    color: var(--ade-text-light);
    margin: 0 0 4px 0;
}

.ade-artwork-date {
    font-size: 13px;
    color: var(--ade-text-light);
    margin: 0;
}

.ade-artwork-color {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ade-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--ade-border);
}

.ade-color-label {
    font-size: 12px;
    color: var(--ade-text-light);
}

/* ======================================
   Loading State
   ====================================== */
.ade-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.ade-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--ade-border);
    border-top-color: var(--ade-primary);
    border-radius: 50%;
    animation: ade-spin 1s linear infinite;
}

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

.ade-loading p {
    margin-top: 16px;
    color: var(--ade-text-light);
    font-size: 14px;
}

/* ======================================
   Empty State
   ====================================== */
.ade-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: var(--ade-white);
    border-radius: var(--ade-radius-lg);
}

.ade-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.ade-empty-state h3 {
    font-size: 20px;
    color: var(--ade-text);
    margin: 0 0 8px 0;
}

.ade-empty-state p {
    color: var(--ade-text-light);
    margin: 0;
}

/* ======================================
   Pagination
   ====================================== */
.ade-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 20px;
}

.ade-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--ade-border);
    border-radius: var(--ade-radius);
    background: var(--ade-white);
    color: var(--ade-text);
    cursor: pointer;
    transition: all var(--ade-transition);
}

.ade-page-btn:hover:not(:disabled) {
    border-color: var(--ade-primary);
    color: var(--ade-primary);
}

.ade-page-btn.active {
    background: var(--ade-primary);
    border-color: var(--ade-primary);
    color: var(--ade-white);
}

.ade-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ade-page-ellipsis {
    color: var(--ade-text-light);
    padding: 0 8px;
}

/* ======================================
   Modal
   ====================================== */
.ade-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    animation: ade-fade-in 0.3s ease;
}

@keyframes ade-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ade-modal-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--ade-white);
    border-radius: var(--ade-radius-lg);
    overflow: hidden;
    animation: ade-slide-up 0.3s ease;
}

@keyframes ade-slide-up {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ade-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
    background: var(--ade-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--ade-shadow);
    transition: all var(--ade-transition);
}

.ade-modal-close:hover {
    background: var(--ade-primary);
    color: var(--ade-white);
}

.ade-modal-body {
    display: grid;
    grid-template-columns: 1fr 400px;
    max-height: 90vh;
}

.ade-zoom-viewer {
    height: 80vh;
    background: #1a1a1a;
}

.ade-modal-info {
    padding: 32px;
    overflow-y: auto;
    max-height: 80vh;
}

.ade-modal-info h2 {
    font-size: 24px;
    line-height: 1.3;
    color: var(--ade-text);
    margin: 0 0 16px 0;
}

.ade-modal-artist {
    font-size: 16px;
    color: var(--ade-primary);
    font-weight: 500;
    margin: 0 0 8px 0 !important;
}

.ade-modal-date,
.ade-modal-medium,
.ade-modal-dimensions,
.ade-modal-department {
    font-size: 14px;
    color: var(--ade-text-light);
    margin: 0 0 8px 0 !important;
}

.ade-modal-description {
    margin: 24px 0 !important;
    padding-top: 16px;
    border-top: 1px solid var(--ade-border);
    font-size: 14px;
    line-height: 1.7;
    color: var(--ade-text);
}

.ade-modal-info .ade-btn {
    width: 100%;
    justify-content: center;
    margin-top: 16px;
}

/* ======================================
   Responsive
   ====================================== */
@media (max-width: 900px) {
    .ade-modal-body {
        grid-template-columns: 1fr;
    }
    
    .ade-zoom-viewer {
        height: 50vh;
    }
    
    .ade-modal-info {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .ade-controls {
        padding: 16px;
    }
    
    .ade-search-wrapper {
        flex-direction: column;
    }
    
    .ade-filters {
        grid-template-columns: 1fr;
    }
    
    .ade-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ade-view-toggle {
        margin-left: 0;
        justify-content: center;
    }
    
    .ade-gallery.ade-view-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .ade-view-list .ade-artwork-card {
        grid-template-columns: 1fr;
    }
    
    .ade-view-list .ade-artwork-image-wrapper {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .ade-container {
        padding: 12px;
    }
    
    .ade-gallery.ade-view-grid {
        grid-template-columns: 1fr;
    }
    
    .ade-artwork-title {
        font-size: 15px;
    }
    
    .ade-pagination {
        flex-wrap: wrap;
    }
}
