/* PDF Request System Styles */

/* PDF Request Button */
.pdf-request-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border: 1px solid #2196f3;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    white-space: nowrap;
    font-weight: 500;
}

.pdf-request-btn:hover {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* PDF Request Modal */
.pdf-request-modal {
    max-width: 600px;
    width: 90%;
}

.publication-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2196f3;
}

.publication-info h3 {
    margin: 0 0 0.5rem 0;
    color: #1976d2;
    font-size: 1.1rem;
}

.publication-info p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.pdf-request-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-notice {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.request-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: #e65100;
}

/* PDF Request Cards in Admin Panel */
.pdf-request-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.request-header h4 {
    margin: 0;
    color: var(--text-primary, #1f2937);
    font-size: 1.1rem;
}

.request-date {
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.request-details {
    margin-bottom: 1.5rem;
}

.request-details p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
}

.request-details strong {
    color: var(--text-primary, #1f2937);
}

/* File Upload Section */
.file-upload-section {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    transition: all 0.3s ease;
}

.file-upload-section:hover {
    border-color: #2196f3;
    background: #f0f8ff;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.file-preview {
    margin-top: 1rem;
}

.file-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    font-weight: 500;
    color: #1f2937;
}

.file-size {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Request Actions */
.request-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

/* Admin Stats for PDF Requests */
.pdf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.pdf-stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pdf-stat-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2196f3;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

/* Static PDF Modal Styles */
.pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pdf-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    cursor: default;
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px 12px 0 0;
}

.pdf-modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.pdf-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pdf-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.pdf-modal-body {
    padding: 1.5rem;
}

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

.pdf-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.pdf-form-group input,
.pdf-form-group select,
.pdf-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pdf-form-group input:focus,
.pdf-form-group select:focus,
.pdf-form-group textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.pdf-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.pdf-form-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9rem;
}

.pdf-form-actions button[type="button"] {
    background: #f3f4f6;
    color: #374151;
}

.pdf-form-actions button[type="button"]:hover {
    background: #e5e7eb;
}

.pdf-form-actions button[type="submit"] {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

.pdf-form-actions button[type="submit"]:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* No Requests State */
.no-requests {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary, #6b7280);
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
}

.no-requests p {
    margin: 0;
    font-size: 1.1rem;
}

/* Publication Actions Container */
.publication-actions,
.pub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    align-items: center;
    justify-content: flex-start;
}

/* Ensure publication items show actions */
.publication-item .publication-actions,
.pub-item .pub-actions {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Enhanced Responsive Design */

/* Large Desktop */
@media (min-width: 1200px) {
    .pdf-request-modal {
        max-width: 700px;
    }
    
    .pdf-request-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
}

/* Desktop/Tablet */
@media (max-width: 1199px) and (min-width: 769px) {
    .pdf-request-modal {
        max-width: 600px;
        width: 85%;
    }
    
    .pdf-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .pdf-request-btn {
        padding: 0.55rem 1.1rem;
        font-size: 0.9rem;
    }
}

/* Tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .pdf-request-modal {
        width: 90%;
        margin: 1.5rem;
    }
    
    .pdf-modal-content {
        width: 85%;
    }
    
    .pdf-modal-header {
        padding: 1.25rem;
    }
    
    .pdf-modal-header h3 {
        font-size: 1.15rem;
    }
    
    .pdf-modal-body {
        padding: 1.25rem;
    }
    
    .pdf-form-group {
        margin-bottom: 1.25rem;
    }
    
    .pdf-form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .pdf-form-group input,
    .pdf-form-group select,
    .pdf-form-group textarea {
        padding: 0.65rem;
        font-size: 0.85rem;
    }
    
    .pdf-form-actions {
        gap: 0.75rem;
        flex-direction: row;
    }
    
    .pdf-form-actions button {
        flex: 1;
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }
    
    .request-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .request-actions {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .pdf-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .file-upload-section {
        padding: 1.25rem;
    }
    
    .publication-actions {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
    }
    
    .pdf-request-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        margin: 0;
        flex: none;
        min-width: 120px;
    }
}

/* Mobile Large */
@media (max-width: 480px) {
    .pdf-request-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .pdf-modal-content {
        width: 95%;
        border-radius: 8px;
    }
    
    .pdf-modal-header {
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .pdf-modal-header h3 {
        font-size: 1rem;
        flex: 1;
        text-align: left;
    }
    
    .pdf-modal-close {
        font-size: 1.25rem;
        padding: 0.25rem;
    }
    
    .pdf-modal-body {
        padding: 1rem;
    }
    
    .pdf-form-group {
        margin-bottom: 1rem;
    }
    
    .pdf-form-group label {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
        font-weight: 600;
    }
    
    .pdf-form-group input,
    .pdf-form-group select,
    .pdf-form-group textarea {
        padding: 0.6rem;
        font-size: 0.8rem;
        border-radius: 4px;
    }
    
    .pdf-form-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 0.75rem;
    }
    
    .pdf-form-actions button {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.85rem;
        border-radius: 4px;
    }
    
    .pdf-request-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .request-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .request-header h4 {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .request-date {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
    
    .request-details {
        margin-bottom: 1rem;
    }
    
    .request-details p {
        font-size: 0.8rem;
        margin: 0.4rem 0;
        line-height: 1.4;
    }
    
    .request-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .request-actions .btn {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .pdf-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .pdf-stat-card {
        padding: 1rem;
        text-align: center;
    }
    
    .pdf-stat-number {
        font-size: 1.5rem;
    }
    
    .file-upload-section {
        padding: 1rem;
        margin: 0.75rem 0;
    }
    
    .file-upload-label {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .file-info {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
        padding: 0.6rem;
    }
    
    .file-name {
        font-size: 0.8rem;
    }
    
    .file-size {
        font-size: 0.75rem;
    }
    
    .publication-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }
    
    .pdf-request-btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem;
        font-size: 0.8rem;
        margin: 0;
        border-radius: 4px;
    }
    
    .pdf-request-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Extra Small Mobile */
@media (max-width: 320px) {
    .pdf-modal-content {
        width: 98%;
        margin: 0.25rem;
    }
    
    .pdf-modal-header {
        padding: 0.75rem;
    }
    
    .pdf-modal-header h3 {
        font-size: 0.9rem;
    }
    
    .pdf-modal-body {
        padding: 0.75rem;
    }
    
    .pdf-form-group {
        margin-bottom: 0.75rem;
    }
    
    .pdf-form-group label {
        font-size: 0.75rem;
    }
    
    .pdf-form-group input,
    .pdf-form-group select,
    .pdf-form-group textarea {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .pdf-form-actions button {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .pdf-request-card {
        padding: 0.75rem;
    }
    
    .request-header h4 {
        font-size: 0.9rem;
    }
    
    .request-details p {
        font-size: 0.75rem;
    }
    
    .pdf-request-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .pdf-request-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .pdf-modal-content {
        max-height: 95vh;
        width: 90%;
    }
    
    .pdf-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .pdf-modal-body {
        padding: 0.75rem 1rem;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .pdf-form-group {
        margin-bottom: 0.75rem;
    }
    
    .pdf-form-actions {
        padding-top: 0.5rem;
    }
}