/* Certificates Page Styles */

/* Hero Section */
.hero-section {
    background: #3A84C5;
    color: white;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #3A84C5;
    opacity: 0.1;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-highlights {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #3A84C5;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1px solid #3A84C5;
}

.highlight-item i {
    font-size: 1.25rem;
    color: white;
}

/* Categories Navigation */
.categories-section {
    background: #DEE2E5;
    padding: 2rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.categories-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.category-btn:hover {
    border-color: #2F6FA6;
    color: #2F6FA6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 111, 166, 0.15);
}

.category-btn.active {
    background: #3A84C5;
    border-color: #3A84C5;
    color: white;
    box-shadow: 0 4px 12px rgba(58, 132, 197, 0.3);
}

.category-btn i {
    font-size: 1.1rem;
}

/* Filters Section */
.filters-section {
    margin-top: 1rem;
}

.filters-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.filter-select,
.filter-input {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #3A84C5;
    box-shadow: 0 0 0 3px rgba(58, 132, 197, 0.1);
}

/* Certificates Grid */
.certificates-section,
.featured-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 3rem;
}

.certificates-grid,
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* Certificate Cards */
.certificate-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    position: relative;
}

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

.certificate-card.featured {
    border: 2px solid #3A84C5;
    box-shadow: 0 8px 25px rgba(58, 132, 197, 0.15);
}

.certificate-card.featured::before {
    content: 'Препоръчан';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #3A84C5;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.certificate-image {
    height: 200px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.certificate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.certificate-image .placeholder-icon {
    font-size: 3rem;
    color: #9ca3af;
}

.certificate-content {
    padding: 1.5rem;
}

.certificate-header {
    margin-bottom: 1rem;
}

.certificate-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.certificate-code {
    font-size: 0.875rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.certificate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.meta-badge.recognition {
    background: #dbeafe;
    color: #1e40af;
}

.meta-badge.difficulty {
    background: #f3e8ff;
    color: #7c3aed;
}

.meta-badge.validity {
    background: #dcfce7;
    color: #166534;
}

.certificate-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.certificate-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.certificate-organization {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.learn-more-btn {
    background: #3A84C5;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.learn-more-btn:hover {
    background: #2F6FA6;
    transform: translateY(-1px);
}

/* Verification Section */
.verification-section {
    background: #DEE2E5;
    padding: 4rem 0;
}

.verification-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
}

.verification-info h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.verification-info p {
    color: #6b7280;
    line-height: 1.6;
}

.verification-form {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3A84C5;
    box-shadow: 0 0 0 3px rgba(58, 132, 197, 0.1);
}

.verify-btn {
    width: 100%;
    background: #059669;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.verify-btn:hover {
    background: #047857;
    transform: translateY(-1px);
}

.verify-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Verification Result */
.verification-result {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

.verification-result.success {
    border-left: 4px solid #059669;
}

.verification-result.error {
    border-left: 4px solid #dc2626;
}

/* Accreditations Section */
.accreditations-section {
    padding: 4rem 0;
    background: white;
}

.accreditations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.accreditation-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.accreditation-card:hover {
    border-color: #3A84C5;
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(58, 132, 197, 0.1);
}

.accreditation-icon {
    width: 80px;
    height: 80px;
    background: #3A84C5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.accreditation-icon i {
    font-size: 2rem;
    color: white;
}

.accreditation-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.accreditation-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.accreditation-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.validity {
    font-size: 0.875rem;
    color: #6b7280;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status.active {
    background: #dcfce7;
    color: #166534;
}

.status.expiring {
    background: #fef3c7;
    color: #92400e;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

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

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

.modal-body {
    padding: 2rem;
}

/* PDF iframe inside modal */
.pdf-frame {
    width: 100%;
    height: 80vh;
    border: none;
}

/* PDF.js container and pages */
.pdf-container {
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.pdf-page {
    display: flex;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    margin: 0 0 16px 0;
}

.pdf-page canvas,
.pdf-page img {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.loading-indicator.active {
    display: block;
}

.loading-indicator i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #3b82f6;
}

/* Admin Link - inherit global header styles from css/style.css */
/* Intentionally no overrides here so .nav-link.admin-link and
   .mobile-nav-link.admin-link look identical to the homepage. */

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-highlights {
        gap: 1rem;
    }
    
    .highlight-item {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .categories-nav {
        gap: 0.5rem;
    }
    
    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .certificates-grid,
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .verification-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .accreditations-grid {
        grid-template-columns: 1fr;
    }
    
    .accreditation-details {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 60px 0 40px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .certificate-content {
        padding: 1rem;
    }
    
    .verification-form {
        padding: 1.5rem;
    }
}
