/* ===================================
   ALBUM VIEW PAGE (BEFORE LIGHTBOX)
   =================================== */

.album-view {
    display: none;
    position: fixed;
    z-index: 19000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    overflow-y: auto;
}

.album-view-header {
    background: linear-gradient(135deg, #e8e8e8 0%, #ffffff 100%);
    padding: 60px 20px 40px;
    text-align: center;
    border-bottom: 3px solid #fbb03a;
}

.album-view-close {
    position: fixed;
    top: 20px;
    right: 40px;
    color: #333;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer !important;
    z-index: 19001;
    transition: all 0.3s ease;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.album-view-close:hover {
    background: #fbb03a;
    color: white;
    transform: rotate(90deg);
}

.album-view-title {
    font-size: 42px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.album-view-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.album-view-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.album-view-description {
    max-width: 900px;
    margin: 20px auto 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    line-height: 1.6;
    color: #555;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.album-view-grid {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px 60px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.album-view-image {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.album-view-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(251, 176, 58, 0.3);
}

.album-view-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.album-view-image::after {
    content: '🔍︎';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 40px;
    color: white;
    background: rgba(251, 176, 58, 0.9);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.album-view-image:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ===================================
   CURSOR FIX FOR LIGHTBOX
   =================================== */

body.lightbox-open {
    cursor: default !important;
}

body.lightbox-open .cursor-dot,
body.lightbox-open .cursor-outline {
    display: none !important;
}

/* ===================================
   ADMIN PANEL STYLES
   =================================== */

.admin-panel {
    background: linear-gradient(135deg, #fff5e6 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 40px;
    margin: 40px auto;
    max-width: 1400px;
    box-shadow: 0 10px 40px rgba(251, 176, 58, 0.1);
    animation: slideDown 0.5s ease;
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #fbb03a;
}

.admin-header h2 {
    color: #ff9500;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-header h2 i {
    font-size: 32px;
}

.admin-actions {
    display: flex;
    gap: 15px;
}

/* ===================================
   BUTTONS
   =================================== */

.btn-primary {
    background: linear-gradient(135deg, #fbb03a 0%, #ff9500 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(251, 176, 58, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 176, 58, 0.4);
}

.btn-secondary {
    background: white;
    color: #ff9500;
    border: 2px solid #fbb03a;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #fff5e6;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757 0%, #e84118 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.btn-edit {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

/* ===================================
   MODAL STYLES
   =================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

.modal-large {
    max-width: 900px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: #ff9500;
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #fbb03a;
}

.close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover,
.close:focus {
    color: #ff9500;
    transform: rotate(90deg);
}

/* ===================================
   FORM STYLES
   =================================== */

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: "Roboto", sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #fbb03a;
    box-shadow: 0 0 0 3px rgba(251, 176, 58, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

/* ===================================
   MESSAGES
   =================================== */

.success-message {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.4s ease;
    font-weight: 500;
}

.error-message {
    background: linear-gradient(135deg, #ff4757 0%, #e84118 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 15px;
    display: none;
    animation: slideDown 0.4s ease;
    font-weight: 500;
}

/* ===================================
   ADMIN ALBUMS LIST
   =================================== */

.admin-albums-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.admin-album-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.admin-album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(251, 176, 58, 0.2);
}

.admin-album-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.admin-album-info {
    padding: 20px;
}

.admin-album-info h4 {
    color: #333;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.admin-album-info .album-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-album-info .album-count {
    color: #fbb03a;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
}

.admin-album-actions {
    display: flex;
    gap: 10px;
}

/* ===================================
   IMAGE FIELDS
   =================================== */

.images-list {
    margin-bottom: 20px;
}

.image-field {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.image-field input {
    flex: 1;
}

.image-field button {
    flex-shrink: 0;
}

/* ===================================
   LIGHTBOX STYLES
   =================================== */

.lightbox {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
    cursor: default;
}

.lightbox * {
    cursor: default;
}

.lightbox button {
    cursor: pointer !important;
}

.lightbox-thumbnail {
    cursor: pointer !important;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    margin: 5vh auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer !important;
    z-index: 20001;
    transition: all 0.3s ease;
    background: transparent;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: white;
    border: none;
    font-size: 30px;
    padding: 20px 25px;
    cursor: pointer !important;
    border-radius: 10px;
    transition: all 0.3s ease;
    z-index: 20001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-caption {
    text-align: center;
    color: white;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.lightbox-caption h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #fbb03a;
}

.lightbox-caption p {
    font-size: 16px;
    color: #ddd;
}

.lightbox-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(251, 176, 58, 0.5);
    border-radius: 10px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 176, 58, 0.8);
}

.lightbox-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.lightbox-thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lightbox-thumbnail.active {
    opacity: 1;
    border-color: #fbb03a;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .album-view-header {
        padding: 40px 15px 30px;
    }

    .album-view-title {
        font-size: 28px;
    }

    .album-view-meta {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .album-view-description {
        font-size: 14px;
        padding: 15px;
    }

    .album-view-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        margin: 30px auto;
        padding: 0 15px 40px;
    }

    .album-view-image img {
        height: 180px;
    }

    .album-view-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .admin-panel {
        padding: 20px;
        margin: 20px 10px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-header h2 {
        font-size: 22px;
    }

    .admin-actions {
        width: 100%;
        flex-direction: column;
    }

    .admin-actions button {
        width: 100%;
    }

    .admin-albums-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 25px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 22px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    .admin-album-actions {
        flex-direction: column;
    }

    .admin-album-actions button {
        width: 100%;
    }

    .lightbox-content {
        width: 95%;
        height: 95vh;
        margin: 2.5vh auto;
    }

    .lightbox-content img {
        max-height: 60vh;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 35px;
        width: 45px;
        height: 45px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        padding: 15px 18px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption h3 {
        font-size: 18px;
    }

    .lightbox-caption p {
        font-size: 14px;
    }

    .lightbox-thumbnails {
        gap: 5px;
        margin-top: 15px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .lightbox-thumbnail {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .image-field {
        flex-direction: column;
    }

    .image-field button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-header h2 {
        font-size: 20px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px 18px;
        font-size: 14px;
    }

    .lightbox-content img {
        max-height: 50vh;
    }
}

/* ===================================
   LOADING ANIMATION
   =================================== */

.loading {
    text-align: center;
    padding: 40px;
    color: #fbb03a;
    font-size: 18px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}
