/* static/css/publications/publication_detail.css */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Hero Section */
.publication-detail-hero {
    background: linear-gradient(135deg, #7b8ceb 0%, #8a5db8 100%);
    padding: 120px 0 40px 0;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.publication-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.breadcrumb-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.breadcrumb {
    background: none;
    margin-bottom: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: rgba(255, 255, 255, 0.6);
    padding-right: 0.5rem;
    font-weight: 600;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: white;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

/* Main Content */
.publication-detail-content {
    padding: 60px 0 80px 0;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    min-height: 70vh;
}

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

.publication-article {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 50px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.publication-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* Publication Header */
.publication-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 35px;
    margin-bottom: 45px;
    position: relative;
}

.publication-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.publication-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.publication-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    padding: 8px 0;
}

.meta-item strong {
    color: #495057;
    min-width: 130px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item strong::before {
    font-family: "Bootstrap Icons";
    font-size: 1.1rem;
    color: #667eea;
}

.meta-item:nth-child(1) strong::before {
    content: "\f4da"; /* person icon */
}

.meta-item:nth-child(2) strong::before {
    content: "\f1ec"; /* calendar icon */
}

.meta-item:nth-child(3) strong::before {
    content: "\f4ca"; /* pencil icon */
}

.author-name {
    color: #6c757d;
    font-weight: 500;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

.publication-date,
.modified-date {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.publication-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 25px;
}

.publication-actions .btn {
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    font-size: 0.95rem;
    min-width: 140px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4c93);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-outline-secondary {
    color: #6c757d;
    border: 2px solid #6c757d;
    background: white;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-outline-primary {
    color: #667eea;
    border: 2px solid #667eea;
    background: white;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* PDF Preview Section */
.pdf-preview-section {
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease-out;
}

.pdf-preview-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.pdf-preview-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.pdf-preview-card .card-body {
    padding: 2rem;
}

.pdf-embed {
    border: none;
    border-radius: 0 0 12px 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdf-fallback {
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Enhanced buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    font-weight: 500;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4c93);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* Card styling improvements */
.card {
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* PDF Loading State */
.pdf-preview-card.loading .pdf-embed {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

/* Publication Body */
.publication-body h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 25px;
    margin-top: 40px;
    border-left: 5px solid #667eea;
    padding-left: 20px;
    position: relative;
}

.publication-body h2::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    border-radius: 3px;
}

.publication-body h3 {
    color: #495057;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 35px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.description-section {
    margin-bottom: 45px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.description-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #555;
    text-align: justify;
    background: #fdfdfd;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.description-content p {
    margin-bottom: 1.5rem;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* File Info Section */
.file-info-section,
.external-link-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 35px;
    border-left: 5px solid #28a745;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.external-link-section {
    border-left-color: #17a2b8;
}

.file-info,
.external-link-info {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.file-icon,
.link-icon {
    font-size: 2.5rem;
    margin-top: 8px;
    background: white;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.file-details p,
.link-details p {
    margin-bottom: 10px;
    color: #555;
    font-weight: 500;
}

.file-details p:last-child,
.link-details p:last-child {
    margin-bottom: 0;
}

.external-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    word-break: break-all;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.external-link:hover {
    color: #5a6fd8;
    text-decoration: none;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .publication-article {
        padding: 40px;
    }
    
    .publication-title {
        font-size: 2.5rem;
    }
    .pdf-preview-section {
        margin-bottom: 40px;
    }
    
    .pdf-preview-card .card-body {
        padding: 1.5rem;
    }
    
    .pdf-embed {
        height: 500px;
    }
    
    .d-grid.gap-2 {
        gap: 0.75rem !important;
    }
}

@media (max-width: 992px) {
    .publication-article {
        padding: 35px;
    }
    
    .publication-title {
        font-size: 2.25rem;
    }
    
    .pdf-viewer {
        height: 600px;
    }
}

@media (max-width: 768px) {
    .publication-detail-hero {
        padding: 100px 0 30px 0;
    }
    
    .publication-article {
        padding: 30px;
        margin: 0 15px;
        border-radius: 15px;
    }
    
    .publication-title {
        font-size: 2rem;
        text-align: left;
    }
    
    .publication-title::after {
        left: 0;
        transform: none;
    }
    
    .publication-meta {
        padding: 20px;
    }
    
    .meta-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .meta-item strong {
        min-width: auto;
    }
    
    .publication-actions {
        justify-content: center;
        gap: 10px;
    }
    
    .publication-actions .btn {
        min-width: 120px;
        padding: 10px 20px;
    }
    
    .file-info,
    .external-link-info {
        flex-direction: column;
        text-align: center;
    }
    
    .file-icon,
    .link-icon {
        align-self: center;
    }
    
    .pdf-viewer {
        height: 500px;
    }
    
    .description-content {
        padding: 25px;
        font-size: 1.05rem;
    }
}

@media (max-width: 576px) {
    .publication-detail-content {
        padding: 40px 0 60px 0;
    }
    
    .publication-article {
        padding: 25px;
        border-radius: 12px;
    }
    
    .publication-title {
        font-size: 1.75rem;
        line-height: 1.4;
        margin-bottom: 25px;
    }
    
    .publication-body h2 {
        font-size: 1.6rem;
        margin-top: 30px;
        margin-bottom: 20px;
    }
    
    .publication-body h3 {
        font-size: 1.3rem;
        margin-top: 25px;
        margin-bottom: 15px;
    }
    
    .description-content {
        font-size: 1rem;
        padding: 20px;
        line-height: 1.7;
    }
    
    .publication-actions .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
        min-width: 100px;
    }
    
    .file-info-section,
    .external-link-section {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .pdf-viewer {
        height: 400px;
    }
    
    .pdf-viewer-container {
        padding: 15px;
    }
    
    .publication-meta {
        padding: 15px;
        gap: 10px;
    }
    
    .meta-item {
        font-size: 0.95rem;
    }
    
    .breadcrumb-item {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .publication-title {
        font-size: 1.5rem;
    }
    
    .publication-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .publication-actions .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .pdf-viewer {
        height: 350px;
    }
    
    .description-content {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .file-icon,
    .link-icon {
        font-size: 2rem;
        padding: 12px;
    }
}

/* Loading States */
.pdf-viewer[data-loading="true"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Focus States for Accessibility */
.btn:focus,
.external-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.pdf-viewer:focus {
    outline: 2px solid #667eea;
    outline-offset: 4px;
}

@media (max-width: 1280px) {
    .publication-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .publication-article {
        padding: 30px;
    }
    .publication-title {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .publication-detail-hero,
    .publication-actions,
    .pdf-controls,
    .breadcrumb-nav {
        display: none;
    }
    
    .publication-article {
        box-shadow: none;
        border: 1px solid #ddd;
        padding: 20px;
        margin: 0;
    }
    
    .publication-title {
        font-size: 1.8rem;
        color: #000;
        text-align: center;
    }
    
    .publication-title::after {
        display: none;
    }
    
    .pdf-viewer-section {
        display: none;
    }
    
    .description-content {
        background: white;
        border: none;
        box-shadow: none;
        padding: 0;
    }
    
    .file-info-section,
    .external-link-section {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .publication-body h2,
    .publication-body h3 {
        color: #000;
    }
    
    .publication-body h2::before {
        display: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .publication-article {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .publication-title {
        color: #ffffff;
    }
    
    .publication-meta {
        background: #2a2a2a;
        border-left-color: #667eea;
    }
    
    .description-content {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #404040;
    }
    
    .file-info-section,
    .external-link-section {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .pdf-viewer-container {
        background: #2a2a2a;
        border-color: #404040;
    }
}