/* Certificate Downloader - DigiCoders Theme */

:root {
    /* Primary Colors - Based on DigiCoders Logo */
    --primary-color: #FF6B35;
    /* Coral Orange */
    --primary-dark: #E85A2A;
    --primary-light: #FF8C61;

    /* Secondary Colors - Teal from Logo */
    --secondary-color: #00B4D8;
    /* Bright Teal */
    --secondary-dark: #0096C7;
    --secondary-light: #48CAE4;

    /* Accent Colors */
    --accent-orange: #FF9F1C;
    /* Bright Orange */
    --accent-teal: #06D6A0;
    /* Mint Teal */

    /* Semantic Colors */
    --success-color: #06D6A0;
    --success-light: #2DE1B1;
    --info-color: #00B4D8;
    --info-light: #48CAE4;
    --warning-color: #FF9F1C;
    --danger-color: #EF476F;

    /* Neutral Colors */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Background & Surface */
    --card-bg: #FFFFFF;
    --card-bg-hover: #FAFBFC;
    --overlay-bg: rgba(0, 0, 0, 0.5);

    /* Text Colors */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-white: #FFFFFF;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --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.15);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FFE5D9 0%, #CAF0F8 50%, #ADE8F4 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    position: relative;
    font-size: 14px;
    line-height: 1.5;
}

/* Animated background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 180, 216, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(6, 214, 160, 0.15) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

.container {
    max-width: 1200px;
    position: relative;
    z-index: 1;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Header Styles */
.header-section {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.header-section h1 {
    color: var(--text-primary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    font-size: 1.75rem;
}

.header-section p,
.header-section .text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.9375rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.header-section .badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    color: var(--text-white) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    font-weight: 600;
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
}

.header-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.header-logo {
    height: 80px;
    width: auto;
    display: inline-block;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    margin-bottom: 0.75rem;
}

.header-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

/* Footer Styles */
.footer {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1.25rem 0;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.footer-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.footer-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-dark);
    background: rgba(255, 107, 53, 0.1);
}

.footer-link:hover::after {
    width: 100%;
}

/* Pagination Styles */
.pagination-wrapper {
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--gray-200);
}

.pagination {
    margin-bottom: 0;
    gap: 0.25rem;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    border: 1px solid var(--gray-300);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--card-bg);
    margin: 0;
    font-size: 0.875rem;
}

.pagination .page-link:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(0, 180, 216, 0.1));
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.2);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: var(--text-white);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

.pagination-info {
    margin-top: 0.5rem;
}

.pagination-info small {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -5px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-white);
    padding: 1rem 1.5rem;
    border-bottom: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 0;
    background: var(--card-bg);
}

/* Table Styles */
.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: linear-gradient(to bottom, var(--gray-50), var(--gray-100));
    color: var(--gray-900);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    padding: 0.875rem 1.25rem;
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-200);
    color: var(--text-primary);
}

.table tbody tr {
    transition: all 0.2s ease;
    background: var(--card-bg);
}

.table tbody tr:hover {
    background: linear-gradient(to right, rgba(255, 107, 53, 0.05), rgba(0, 180, 216, 0.05));
    transform: scale(1.001);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badge Styles */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    font-size: 0.6875rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color), var(--success-light)) !important;
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #FF6B9D) !important;
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--info-color), var(--info-light)) !important;
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Button Styles */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
    font-size: 0.875rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.4);
    color: var(--text-white);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), var(--success-light));
    color: var(--text-white);
    box-shadow: 0 2px 4px rgba(6, 214, 160, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #05C293, var(--success-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(6, 214, 160, 0.4);
    color: var(--text-white);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), var(--info-light));
    color: var(--text-white);
    box-shadow: 0 2px 4px rgba(0, 180, 216, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--secondary-dark), var(--info-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 180, 216, 0.4);
    color: var(--text-white);
}

.btn-outline-secondary {
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn i {
    position: relative;
    z-index: 1;
}

/* Search Box */
.search-box {
    min-width: 250px;
}

.search-box input {
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    background: var(--text-white);
    transform: translateY(-1px);
}

/* Modal Styles */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.modal-header .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
    transition: all 0.3s ease;
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--gray-50);
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    background: var(--card-bg);
}

/* Preview Content */
#previewContent img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--text-white);
}

#previewContent iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--text-white);
}

/* Loading Spinner */
.spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.3rem;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    .header-section {
        padding: 1.25rem 1.25rem;
        margin-bottom: 1.25rem;
    }

    .header-section h1 {
        font-size: 1.5rem;
    }

    .header-section p {
        font-size: 0.875rem;
    }

    .search-box {
        min-width: 100%;
        margin-top: 0.75rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        padding: 1rem 1.25rem;
    }

    .table {
        font-size: 0.8125rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem 1rem;
    }

    .btn-sm {
        padding: 0.3rem 0.625rem;
        font-size: 0.75rem;
    }

    .card {
        border-radius: var(--radius-md);
    }

    .footer {
        padding: 1rem 0;
        margin-bottom: 1.25rem;
    }

    .footer-content p {
        font-size: 0.8125rem;
    }

    .header-logo {
        height: 60px;
        margin-bottom: 0.5rem;
    }

    .pagination-wrapper {
        padding: 0.875rem 1rem;
    }

    .pagination .page-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.8125rem;
    }

    .pagination-info small {
        font-size: 0.75rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

.table tbody tr {
    animation: slideInRight 0.3s ease;
}

.table tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.table tbody tr:nth-child(2) {
    animation-delay: 0.1s;
}

.table tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.table tbody tr:nth-child(4) {
    animation-delay: 0.2s;
}

.table tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

/* Utility Classes */
.text-muted {
    color: var(--text-muted) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    body::before {
        display: none;
    }

    .btn {
        display: none;
    }
}