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

:root {
    --primary-color: #b01504;
    --secondary-color: #ce2f2f;
    --accent-color: #b01504;
    --text-color: #333;
    --light-color: #f5f5f5;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f0f4f8;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    text-align: center;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    overflow-y: auto;
    padding: 0;
    position: relative;
}

main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 1;
}

.certificate-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin: 20px;
    max-width: 500px;
    width: 100%;
    border-top: 5px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 2;
}

.certificate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(176, 21, 4, 0.05) 0%, rgba(206, 47, 47, 0.02) 100%);
    border-radius: var(--border-radius);
    z-index: -1;
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.program-title {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.program-title h3 {
    color: #165783;
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.program-title h4 {
    color: #555;
    font-size: 1.2rem;
    font-weight: 600;
}

.card-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.card-header p {
    color: #666;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    color: #444;
    position: relative;
    padding-right: 15px;
}

.form-group label::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.input-wrapper {
    position: relative;
}

input[type="tel"] {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
    text-align: center;
    letter-spacing: 1px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

input[type="tel"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(176, 21, 4, 0.2);
}

.form-group small {
    display: block;
    color: #777;
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    width: 100%;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    z-index: -1;
    transition: opacity 0.3s;
    opacity: 0;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(176, 21, 4, 0.3);
}

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

/* Modal Popup Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s;
    border-top: 5px solid var(--primary-color);
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
}

.close-modal:hover {
    color: var(--primary-color);

    background-color: rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 25px 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
    background-color: #f9f9f9;
}

.modal-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: 30px 25px;
}

#certificateResult {
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.1rem;
}

.success-message {
    background-color: rgba(46, 204, 113, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.download-container {
    text-align: center;
    margin-top: 20px;
}

.btn-download {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border: none;
    padding: 14px 30px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 10px rgba(176, 21, 4, 0.2);
}

.btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    transition: all 0.4s;
    z-index: -1;
}

.btn-download:hover::before {
    left: 0;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(176, 21, 4, 0.3);
    color: white;
}

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

/* Footer Styles */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    text-align: center;
    z-index: 10;
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer p {
    opacity: 0.9;
    font-size: 0.9rem;
    margin: 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 5px solid var(--accent-color);
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        margin-bottom: 15px;
    }

    nav ul {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-content h2 {
        font-size: 2rem;
    }

    .certificate-form-container {
        padding: 30px 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-contact p {
        justify-content: center;
    }

    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    header {
        height: 70px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .certificate-card {
        padding: 30px 20px;
        margin: 15px;
    }

    .program-title h3 {
        font-size: 1.2rem;
    }

    .program-title h4 {
        font-size: 1rem;
    }

    .card-header h2 {
        font-size: 1.5rem;
    }

    .card-header p {
        font-size: 1rem;
    }

    .form-group label {
        font-size: 1rem;
    }

    input[type="tel"], .btn-primary, .btn-download {
        font-size: 1rem;
        padding: 12px 20px;
    }

    footer {
        height: 40px;
    }
}
