/* ── Photo Gallery Drive — Frontend CSS (v2 Blue Theme) ──────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --pgd-primary:       #3757A2;
    --pgd-primary-dark:  #263A78;
    --pgd-primary-light: #EDF1FA;
    --pgd-accent:        #27AE60;
    --pgd-text:          #2C3E50;
    --pgd-border:        #A8BDE0;
    --pgd-white:         #ffffff;
    --pgd-overlay:       rgba(37, 58, 120, 0.82);
    --pgd-radius:        10px;
    --pgd-shadow:        0 4px 20px rgba(55, 87, 162, 0.12);
    --pgd-transition:    0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ──────────────────────────────────────────────────────────── */
.pgd-gallery-wrap {
    font-family: 'DM Sans', sans-serif;
    padding: 8px 0;
    color: var(--pgd-text);
}

/* ── Album Grid ────────────────────────────────────────────────────── */
.pgd-album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 768px) { .pgd-album-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pgd-album-grid { grid-template-columns: 1fr; } }

.pgd-album-card {
    border-radius: var(--pgd-radius);
    overflow: hidden;
    background: var(--pgd-white);
    box-shadow: var(--pgd-shadow);
    cursor: pointer;
    transition: transform var(--pgd-transition), box-shadow var(--pgd-transition);
    border: 1px solid var(--pgd-border);
}
.pgd-album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 44px rgba(55, 87, 162, 0.24);
}

.pgd-album-cover {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--pgd-primary-light);
}
.pgd-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--pgd-transition);
}
.pgd-album-card:hover .pgd-album-cover img { transform: scale(1.07); }

.pgd-album-overlay {
    position: absolute;
    inset: 0;
    background: var(--pgd-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--pgd-transition);
}
.pgd-album-card:hover .pgd-album-overlay { opacity: 1; }

.pgd-album-icon {
    width: 52px;
    height: 52px;
    color: var(--pgd-white);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.pgd-album-no-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--pgd-primary-light), var(--pgd-border));
}

.pgd-album-info {
    padding: 14px 16px;
    background: var(--pgd-white);
    border-top: 2px solid var(--pgd-primary-light);
}
.pgd-album-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--pgd-primary-dark);
    margin-bottom: 3px;
    font-style: italic;
}
.pgd-album-count {
    font-size: 12px;
    color: var(--pgd-primary);
    font-weight: 500;
}

/* ── Photos View Header ────────────────────────────────────────────── */
.pgd-photos-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--pgd-primary-light);
}
.pgd-photos-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--pgd-primary-dark);
    font-style: italic;
    font-weight: 600;
}

.pgd-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--pgd-primary-light);
    color: var(--pgd-primary-dark);
    border: 1px solid var(--pgd-border);
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.pgd-btn-back:hover {
    background: var(--pgd-primary);
    color: var(--pgd-white);
    border-color: var(--pgd-primary);
}
.pgd-btn-back svg { width: 16px; height: 16px; }

/* ── Photo Grid ────────────────────────────────────────────────────── */
.pgd-grid { display: grid; gap: 16px; }
.pgd-cols-2 { grid-template-columns: repeat(2, 1fr); }
.pgd-cols-3 { grid-template-columns: repeat(3, 1fr); }
.pgd-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
    .pgd-cols-3, .pgd-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .pgd-cols-2, .pgd-cols-3, .pgd-cols-4 { grid-template-columns: 1fr; }
}

/* ── Gallery Item ──────────────────────────────────────────────────── */
.pgd-item {
    position: relative;
    border-radius: var(--pgd-radius);
    overflow: hidden;
    background: var(--pgd-white);
    box-shadow: var(--pgd-shadow);
    transition: transform var(--pgd-transition), box-shadow var(--pgd-transition);
    border: 1px solid var(--pgd-border);
}
.pgd-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(55, 87, 162, 0.22);
}

.pgd-thumb-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}
.pgd-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--pgd-transition);
    display: block;
}
.pgd-item:hover .pgd-thumb { transform: scale(1.06); }

/* ── Overlay Buttons ───────────────────────────────────────────────── */
.pgd-overlay {
    position: absolute;
    inset: 0;
    background: var(--pgd-overlay);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity var(--pgd-transition);
}
.pgd-item:hover .pgd-overlay { opacity: 1; }

.pgd-btn-view,
.pgd-btn-download {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border: none;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.pgd-btn-view svg, .pgd-btn-download svg { width: 15px; height: 15px; }

.pgd-btn-view {
    background: rgba(255,255,255,0.15);
    color: var(--pgd-white);
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(4px);
}
.pgd-btn-view:hover { background: rgba(255,255,255,0.28); }

.pgd-btn-download {
    background: var(--pgd-primary);
    color: var(--pgd-white);
    font-weight: 600;
}
.pgd-btn-download:hover { background: var(--pgd-primary-dark); transform: scale(1.04); }

.pgd-caption {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--pgd-text);
    background: var(--pgd-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}

/* ── Modal Base ────────────────────────────────────────────────────── */
.pgd-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 58, 120, 0.90);
    backdrop-filter: blur(6px);
    padding: 20px;
    animation: pgdFadeIn 0.2s ease;
}
.pgd-hidden { display: none !important; }

@keyframes pgdFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pgdSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.pgd-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--pgd-white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}
.pgd-close-btn:hover { background: rgba(255,255,255,0.28); }

/* ── Lightbox Modal ────────────────────────────────────────────────── */
.pgd-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: pgdSlideUp 0.25s ease;
}
#pgd-lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--pgd-radius);
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    object-fit: contain;
}
#pgd-lightbox-meta {
    width: 100%;
    margin-top: 12px;
}
#pgd-lightbox-caption {
    color: rgba(255,255,255,0.9);
    font-size: 15px;
    font-style: italic;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
}
#pgd-lightbox-credit {
    margin-top: 10px;
    padding: 12px 16px;
    background: rgba(55, 87, 162, 0.28);
    border: 1px solid rgba(168, 189, 224, 0.45);
    border-radius: 8px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-line;
    font-family: 'DM Sans', sans-serif;
    max-width: 600px;
}
#pgd-lightbox-credit::before {
    content: 'KREDIT FOTO';
    font-weight: 700;
    color: var(--pgd-border);
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    letter-spacing: 1px;
}

/* ── Form Modal ────────────────────────────────────────────────────── */
.pgd-form-inner {
    background: var(--pgd-white);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    position: relative;
    animation: pgdSlideUp 0.25s ease;
    box-shadow: 0 32px 80px rgba(37, 58, 120, 0.4);
}
.pgd-form-inner .pgd-close-btn {
    color: var(--pgd-text);
    background: rgba(55, 87, 162, 0.08);
    border-color: var(--pgd-border);
}

.pgd-form-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pgd-primary-light);
}
.pgd-form-header h2 {
    font-size: 22px;
    color: var(--pgd-primary-dark);
    margin: 0 0 8px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
}
.pgd-form-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}
.pgd-icon { font-size: 40px; margin-bottom: 12px; display: block; }

/* ── Form Fields ───────────────────────────────────────────────────── */
.pgd-field { margin-bottom: 16px; }
.pgd-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pgd-primary-dark);
    margin-bottom: 6px;
}
.pgd-field .req { color: #e74c3c; }

.pgd-field input,
.pgd-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--pgd-border);
    border-radius: var(--pgd-radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--pgd-text);
    background: var(--pgd-primary-light);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.pgd-field input:focus,
.pgd-field textarea:focus {
    outline: none;
    border-color: var(--pgd-primary);
    box-shadow: 0 0 0 3px rgba(55, 87, 162, 0.15);
    background: var(--pgd-white);
}
.pgd-field input[readonly] {
    background: #d5ddf5;
    color: #666;
}
.pgd-field textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.pgd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    letter-spacing: 0.3px;
}
.pgd-btn-primary {
    background: var(--pgd-primary);
    color: var(--pgd-white);
    width: 100%;
    margin-top: 8px;
}
.pgd-btn-primary:hover { background: var(--pgd-primary-dark); transform: translateY(-1px); }
.pgd-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.pgd-btn-dl {
    background: var(--pgd-primary);
    color: var(--pgd-white);
    font-size: 15px;
    padding: 13px 28px;
    margin-top: 16px;
    border: 2px solid rgba(255,255,255,0.3);
}
.pgd-btn-dl:hover { background: var(--pgd-primary-dark); }

/* ── Misc ──────────────────────────────────────────────────────────── */
.pgd-form-error {
    color: #c0392b;
    font-size: 13px;
    margin-bottom: 10px;
    min-height: 18px;
}
.pgd-privacy {
    font-size: 11.5px;
    color: #999;
    text-align: center;
    margin: 10px 0 0;
}
.pgd-success-icon { filter: none; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.pgd-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--pgd-primary-dark);
    color: var(--pgd-white);
    padding: 14px 22px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    z-index: 100000;
    box-shadow: 0 8px 32px rgba(55, 87, 162, 0.35);
    animation: pgdSlideUp 0.3s ease;
}
.pgd-toast-success { background: var(--pgd-accent); }

.pgd-empty {
    text-align: center;
    padding: 40px;
    color: var(--pgd-primary);
    font-family: 'DM Sans', sans-serif;
    background: var(--pgd-primary-light);
    border-radius: var(--pgd-radius);
    border: 1px dashed var(--pgd-border);
}
