/* ===== RESOURCES PAGE STYLES ===== */
.resource-container {
    background: #f8fafc;
    min-height: 100vh;
}

/* ===== HERO SECTION ===== */
.resource-hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 50%, #f0fdf4 100%);
    padding: 4rem 0;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 48rem;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

.hero-gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== RESOURCES GRID ===== */
.resource-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

.grid-title {
    text-align: center;
    margin-bottom: 3rem;
}

.grid-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.grid-title p {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 32rem;
    margin: 0 auto;
}

/* ===== RESOURCE CARD ===== */
.resource-card {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.resource-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #d1d5db;
    transform: translateY(-2px);
}

.resource-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1.5rem;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
}

.resource-icon {
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    border: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.resource-icon i {
    font-size: 2rem;
    color: white;
}

.resource-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.resource-info p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.resource-badge {
    background: #eff6ff;
    color: #2563eb;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ===== RESOURCE META ===== */
.resource-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #f3f4f6;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.meta-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

/* ===== RESOURCE ACTIONS ===== */
.resource-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
    transform: translateY(-1px);
}

/* ===== MODAL STYLES ===== */
.modal-lg {
    max-width: 1000px;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 1000px;
}

.modal-content {
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 1.5rem 2rem;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 0;
    background: #f8f9fa;
}

.preview-container {
    position: relative;
    min-height: 600px;
    background: #f8f9fa;
    border-radius: 0;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    color: #6c757d;
}

.preview-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.preview-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    z-index: 10;
}

.preview-error .alert {
    background: white;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-error .alert h6 {
    color: #856404;
    margin-bottom: 1rem;
}

.preview-error .alert .fa-exclamation-triangle {
    font-size: 2rem;
    color: #ffc107;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 2rem;
    justify-content: space-between;
    background: white;
    border-radius: 0 0 12px 12px;
}

.modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-footer .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.modal-footer .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

#previewFrame {
    width: 100%;
    height: 600px;
    border: none;
    background: white;
    border-radius: 0;
}

/* Toast notification styles */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    #previewFrame {
        height: 400px;
    }
    
    .preview-container {
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .resource-grid {
        padding: 2rem 0.5rem;
    }
    
    .resource-header {
        padding: 1rem;
    }
    
    .resource-meta {
        padding: 1rem;
    }
    
    .resource-actions {
        padding: 1rem;
    }
}

/* ===== ANIMATION FOR LOADING STATES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resource-card {
    animation: fadeIn 0.6s ease-out;
}

.resource-card:nth-child(2) {
    animation-delay: 0.1s;
}

.resource-card:nth-child(3) {
    animation-delay: 0.2s;
}

.resource-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Fallback modal backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.modal-open .modal-backdrop {
    display: block;
}

.modal-open {
    overflow: hidden;
}

/* Force modal to show on top */
.modal {
    z-index: 1050;
}

.modal.show {
    display: block;
}

/* Custom modal animation */
.modal.fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.fade.show {
    opacity: 1;
}

/* Enhanced close button */
.modal-header .btn-close {
    position: relative;
    z-index: 1060;
}

.modal-header .btn-close:before {
    content: '×';
    font-size: 1.5rem;
    line-height: 1;
}
