/* ============================================
   COMPONENT STYLES
   ============================================ */

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   MODAL/LIGHTBOX
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.modal-image {
    width: 100%;
    height: auto;
    display: block;
}

.modal-info {
    padding: 2rem;
    background: white;
}

.modal-info h3 {
    margin-bottom: 1rem;
    color: #333;
}

.modal-info p {
    color: #666;
    line-height: 1.6;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   IMAGE GALLERY
   ============================================ */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-info {
    text-align: center;
    color: white;
    padding: 1rem;
}

.gallery-item-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.gallery-item-info p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #764ba2;
}

.breadcrumb-separator {
    color: #999;
}

/* ============================================
   TAGS
   ============================================ */

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    color: #495057;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.tag:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tag.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a {
    background: white;
    color: #667eea;
    border: 1px solid #e9ecef;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border: 1px solid #667eea;
}

.pagination .disabled {
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #e9ecef;
}

/* ============================================
   NOTIFICATION/TOAST
   ============================================ */

.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    min-width: 300px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.notification.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8, #667eea);
}

.notification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.notification-close:hover {
    opacity: 1;
}

/* ============================================
   ACCORDION
   ============================================ */

.accordion {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.accordion-item {
    border-bottom: 1px solid #e9ecef;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.accordion-item.active .accordion-content {
    max-height: 300px;
}

.accordion-body {
    padding: 1.5rem;
    color: #666;
    line-height: 1.6;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   TOOLTIP
   ============================================ */

.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MOBILE RESPONSIVE COMPONENTS
   ============================================ */

@media screen and (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .modal-info {
        padding: 1.5rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        transform: translateY(-100%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .pagination {
        gap: 0.3rem;
    }
    
    .pagination a,
    .pagination span {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .accordion-header {
        padding: 1rem;
    }
    
    .accordion-body {
        padding: 1rem;
    }
    
    .tooltip::before {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        white-space: normal;
        max-width: 250px;
    }
    
    .tooltip::after {
        display: none;
    }
}

/* ============================================
   CAPTCHA STYLES
   ============================================ */

.captcha-field {
    margin-bottom: 1.5rem;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.captcha-question {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.captcha-question:hover {
    border-color: #ff6b35;
    background: linear-gradient(135deg, #fff5f0 0%, #ffe8dc 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.15);
}

.captcha-refresh {
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.captcha-refresh:hover {
    background: #e55a2b;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.captcha-field input[type="number"] {
    width: 120px;
    padding: 10px 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.captcha-field input[type="number"]:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Inline layout: question | input | refresh */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-container.inline {
    flex-wrap: nowrap;
}

.captcha-question {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 160px;
    text-align: center;
}

/* Label sits above the inline row */
.captcha-field .captcha-label {
    /* Ensure this label is not affected by the floating-label rules in minimal-style.css */
    position: static !important;
    top: auto !important;
    left: auto !important;
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.2;
}

/* Add a little vertical spacing so the question row never overlaps the label */
.captcha-field .captcha-container {
    margin-top: 4px;
}
