/* ============================================
   BRIEFS GALLERY - WORDPRESS & DIVI 4 STYLES
   ============================================ */

:root {
    --bg-primary: #1e3a5f;
    --bg-secondary: #d4542e;
    --bg-accent: #00a3e0;
    --text-dark: #2c3e50;
    --text-light: #5a6c7d;
    --text-border: #e1e8ed;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================
   WRAPPER & RESETS
   ============================================ */

.briefs-gateway-wrapper {
    padding: 20px 0;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.briefs-gateway-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   CONTROLS SECTION
   ============================================ */

.controls-section {
    margin-bottom: 50px;
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 14px 45px 14px 18px;
    font-size: 1em;
    border: 2px solid var(--text-border);
    border-radius: 8px;
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--bg-accent);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.1);
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-light);
    pointer-events: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--text-border);
    background-color: var(--bg-white);
    color: var(--text-dark);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--bg-secondary);
    color: var(--bg-secondary);
}

.filter-btn.active {
    background-color: var(--bg-secondary);
    color: var(--bg-white);
    border-color: var(--bg-secondary);
}

@media (max-width: 768px) {
    .filters {
        gap: 8px;
    }
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }
}

/* ============================================
   BRIEFS GRID
   ============================================ */

.briefs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.brief-card {
    background-color: var(--bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.brief-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Card Thumbnail */
.brief-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: 3em;
    position: relative;
    overflow: hidden;
}

.brief-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="rgba(255,255,255,0.05)" d="M0,0 L100,0 L100,100 L0,100 Z M20,20 L80,20 L80,80 L20,80 Z"/></svg>');
}

.brief-thumbnail-icon {
    position: relative;
    z-index: 1;
}

.brief-thumbnail-image {
    position: relative;
    z-index: 1;
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Card Content */
.brief-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.brief-category {
    display: inline-block;
    background-color: rgba(212, 84, 46, 0.1);
    color: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    width: fit-content;
}

.brief-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.brief-date {
    font-size: 0.85em;
    color: var(--text-light);
    margin-bottom: 15px;
}

/* Card Footer */
.brief-footer {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--text-border);
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    font-family: inherit;
}

.btn-preview {
    background-color: var(--bg-accent);
    color: var(--bg-white);
}

.btn-preview:hover {
    background-color: #0089b8;
    transform: scale(1.02);
}

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

.btn-download:hover {
    background-color: #b83d24;
    transform: scale(1.02);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .briefs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 1.1em;
}

/* ============================================
   MODAL - PDF VIEWER
   ============================================ */

.briefs-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.briefs-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-white);
    margin: auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    height: 90vh;
    max-width: 1000px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--bg-white);
    border: none;
    font-size: 2em;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

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

.pdf-viewer {
    flex-grow: 1;
    overflow: hidden;
}

.pdf-viewer iframe {
    width: 100%;
    height: 100%;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--text-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-white);
}

.modal-footer p {
    margin: 0;
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
}

.download-link {
    padding: 10px 24px;
    background-color: var(--bg-secondary);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.download-link:hover {
    background-color: #b83d24;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 95vh;
    }
    .modal-footer {
        flex-direction: column;
        gap: 15px;
    }
    .download-link {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.brief-card {
    animation: fadeIn 0.5s ease;
}
