/* ========================================
   Global Styles & Reset
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #e85a2a;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1e293b;
    --gray-dark: #334155;
    --gray-medium: #64748b;
    --gray-light: #cbd5e1;
    --gray-lighter: #f1f5f9;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--white);
    color: var(--dark-color);
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid #f0f0f0;
}

.header-content {
    display: flex;
    align-items: center;
}

.newsroom-logo {
    height: 70px;
    width: auto;
    display: block;
    transition: opacity 0.3s;
}

.newsroom-logo:hover {
    opacity: 0.8;
}

.logo-section {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    height: 50px;
    width: auto;
    transition: all 0.3s;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
    opacity: 0.95;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    padding: 2rem 0 4rem;
}

/* ========================================
   Filter Section
   ======================================== */
.filter-section {
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
    position: relative;
}

/* 스크롤 가능 힌트 (오른쪽 그라디언트) */
.filter-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 768px) {
    .filter-section::after {
        opacity: 1;
    }
}

.category-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

/* 데스크톱에서는 스크롤바 숨김 */
@media (min-width: 769px) {
    .category-tabs {
        scrollbar-width: none;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
}

/* 모바일에서는 얇은 스크롤바 표시 */
@media (max-width: 768px) {
    .category-tabs::-webkit-scrollbar {
        height: 3px;
    }
    
    .category-tabs::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .category-tabs::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 3px;
    }
}

.tab-btn {
    flex-shrink: 0;
    min-width: auto;
    padding: 0.65rem 1rem;
    border: 2px solid var(--gray-light);
    background: var(--white);
    color: var(--gray-dark);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn:hover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
    color: var(--primary-color);
    transform: translateY(-2px);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.tab-btn i {
    font-size: 1rem;
}

/* ========================================
   Press List
   ======================================== */
.press-list {
    display: grid;
    gap: 1.25rem;
}

.press-item {
    background: var(--white);
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.press-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.press-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.press-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.press-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.press-badge.article,
.press-badge-article {
    background: #ffe5d9;
    color: #ff6b35;
}

.press-badge.foreign,
.press-badge-foreign {
    background: #ffd4c4;
    color: #e85a2a;
}

.press-badge.photo,
.press-badge-photo {
    background: #fef3c7;
    color: #d97706;
}

.press-badge.video,
.press-badge-video {
    background: #fee2e2;
    color: #dc2626;
}

.press-item-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    color: var(--gray-medium);
    font-size: 0.9rem;
}

.press-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.press-meta-item i {
    color: var(--dark-color);
}

.press-item-summary {
    color: var(--gray-dark);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
    align-items: flex-start;
    justify-content: center;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 1000px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
    margin: 2rem auto;
}

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

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-lighter);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

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

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid var(--gray-lighter);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 2rem;
    max-height: calc(90vh - 4rem);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .modal-body {
        padding: 1.5rem;
    }
}

.modal-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.modal-detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
    line-height: 1.3;
}

.modal-detail-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-lighter);
}

.modal-detail-summary {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--gray-dark);
    margin-bottom: 1.5rem;
}

.modal-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.modal-detail-link:hover {
    background: var(--secondary-color);
    transform: translateX(4px);
}

/* Photo Gallery in Modal */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.photo-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.photo-gallery .modal-detail-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-bottom: 0;
}

/* Single photo - show full image without cropping */
.photo-gallery.single-photo {
    display: block;
    max-width: 100%;
}

.photo-gallery.single-photo .photo-gallery-item {
    max-width: 100%;
    margin: 0 auto;
}

.photo-gallery.single-photo img {
    height: auto;
    max-height: 500px;
    object-fit: contain;
    width: 100%;
}

/* Photo Modal Specific Styles */
.photo-modal-content {
    padding: 1rem 0;
}

.photo-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.photo-modal-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-lighter);
    font-size: 0.95rem;
    color: var(--gray-medium);
}

.photo-modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.photo-modal-meta i {
    color: var(--primary-color);
}

.photo-modal-summary {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-dark);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-lighter);
    border-radius: 8px;
}

.photo-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.photo-gallery img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* 모바일에서 갤러리 조정 */
@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .photo-gallery img {
        height: auto;
        max-height: 300px;
    }
}

.no-images {
    text-align: center;
    padding: 2rem;
    color: var(--gray-medium);
    font-style: italic;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-light);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.125rem;
    color: var(--gray-medium);
    margin-bottom: 1rem;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1.5rem 0;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-light);
    background: var(--white);
    color: var(--gray-dark);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
}

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

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-dots {
    padding: 0.5rem;
    color: var(--gray-medium);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--dark-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-link {
    color: var(--white);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.3s;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Admin Styles
   ======================================== */
.admin-body {
    background: #f8fafc;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff8a5b 0%, #ff6b35 100%);
    padding: 2rem;
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1.5rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray-medium);
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-hint {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--gray-medium);
}

/* Admin Dashboard */
.admin-header {
    background: var(--white);
    color: var(--dark-color);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-logo-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.admin-logo-main {
    height: 40px;
    width: auto;
}

.admin-logo-presskit {
    height: 80px;
    width: auto;
}

.admin-badge {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.admin-logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-logo-image {
    height: 40px;
    width: auto;
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-info p {
    color: var(--gray-medium);
    font-size: 0.9rem;
}

/* Admin Toolbar */
.admin-toolbar {
    margin-bottom: 1.5rem;
}

/* Admin Table */
.admin-table-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--gray-lighter);
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 1rem;
    border-top: 1px solid var(--gray-lighter);
}

.admin-table tbody tr {
    transition: background 0.2s;
}

.admin-table tbody tr:hover {
    background: rgba(255, 107, 53, 0.03);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* Multiple Images */
.image-url-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.image-url-input {
    flex: 1;
}

.btn-remove-image {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-remove-image:hover {
    background: #dc2626;
}

.text-sm {
    font-size: 0.875rem;
}

.text-gray-500 {
    color: var(--gray-medium);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-lighter);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--gray-dark);
}

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    color: var(--dark-color);
    border: 2px solid var(--primary-color);
}

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

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 0;
    }

    .newsroom-logo {
        height: 55px;
    }

    .admin-logo-container {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .admin-logo-main {
        height: 30px;
    }

    .admin-logo-presskit {
        height: 60px;
    }

    .logo-image {
        height: 40px;
    }

    .login-logo {
        height: 50px;
    }

    .admin-logo-image {
        height: 35px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .category-tabs {
        gap: 0.35rem;
        padding: 0.5rem 0;
    }

    .tab-btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
    }

    .press-item-header {
        flex-direction: column;
    }

    .press-item-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-content {
        margin: 1rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .footer .container {
        flex-direction: column;
        text-align: center;
    }

    .admin-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-table-container {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 600px;
    }

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

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

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .filter-section {
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .category-tabs {
        gap: 0.4rem;
        padding: 0.5rem 0;
        justify-content: flex-start;
    }

    .tab-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
        border-width: 1.5px;
        min-width: fit-content;
        flex-shrink: 0;
    }

    .newsroom-logo {
        height: 45px;
    }

    .press-item {
        padding: 1rem;
    }

    .press-item-title {
        font-size: 1.1rem;
    }

    .login-box {
        padding: 2rem;
    }

    .modal {
        padding: 1rem;
    }
}
