/* ============================================================
   Mastermind Gurukul Certificate Management System
   Main Stylesheet
   ============================================================ */

/* CSS Variables */
:root {
    --primary-color: #ff6b00;
    --secondary-color: #1a1a1a;
    --text-dark: #2c2c2c;
    --text-light: #666;
    --bg-light: #f9f9f9;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    
    --cert-bg: #fdf8f3;
    --cert-border: #d4af37;
    --cert-text: #2c2c2c;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2a2a2a 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.institute-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 14px;
    color: #ccc;
    font-style: italic;
    margin-top: 5px;
}

.contact-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.contact-link.whatsapp:hover {
    background: #25D366;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff8533 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-quote {
    font-size: 18px;
    font-style: italic;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
    opacity: 0.95;
}

.quote-author {
    display: block;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 600;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.search-btn {
    padding: 15px 35px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.search-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn:active {
    transform: translateY(0);
}

.search-message {
    min-height: 30px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.search-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.search-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Sample Serial Numbers */
.sample-serials {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
}

.sample-serials p {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.serial-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.serial-chip {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.3);
}

.serial-chip:hover {
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    transform: scale(1.05);
}

/* Student Info Bar */
.student-info-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin: 30px auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 900px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.info-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
}

.grade-badge {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 16px;
}

/* Certificate Section */
.certificate-section {
    padding: 40px 0;
    background: white;
}

/* Certificate Design - Exact Match */
.certificate {
    max-width: 900px;
    margin: 0 auto;
    background: var(--cert-bg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    position: relative;
}

.certificate-border {
    border: 8px double var(--cert-border);
    padding: 5px;
    position: relative;
}

.certificate-border::before,
.certificate-border::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid var(--cert-border);
}

.certificate-border::before {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.certificate-border::after {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.certificate-content {
    border: 2px solid var(--cert-border);
    padding: 60px 40px;
    background: linear-gradient(135deg, #fefaf5 0%, #fdf8f3 100%);
    position: relative;
}

/* Certificate Background Pattern */
.certificate-content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="80" fill="%23d4af37" opacity="0.05" font-family="serif">MG</text></svg>') no-repeat center;
    background-size: contain;
    pointer-events: none;
}

.certificate-header {
    text-align: center;
    margin-bottom: 40px;
}

.cert-title {
    font-size: 56px;
    font-weight: 700;
    color: var(--cert-border);
    letter-spacing: 8px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.cert-subtitle {
    font-size: 32px;
    font-weight: 600;
    color: var(--cert-text);
    letter-spacing: 4px;
}

.certificate-body {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cert-text-intro {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 20px;
    font-style: italic;
}

.student-name {
    font-size: 48px;
    font-weight: 700;
    color: var(--cert-text);
    margin: 20px 0;
    padding: 0 20px;
    border-bottom: 3px solid var(--cert-border);
    display: inline-block;
    letter-spacing: 2px;
}

.cert-text-course {
    font-size: 16px;
    color: var(--text-light);
    margin: 25px 0 15px;
    letter-spacing: 2px;
}

.course-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 15px 0;
    letter-spacing: 1px;
}

.cert-text-course-suffix {
    font-size: 16px;
    color: var(--text-light);
    margin: 15px 0;
    letter-spacing: 2px;
}

.grade-container {
    margin: 20px 0 30px;
}

.grade-display {
    font-size: 64px;
    font-weight: 700;
    color: var(--cert-border);
    display: inline-block;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border: 4px solid var(--cert-border);
    border-radius: 50%;
    margin-right: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.grade-text {
    font-size: 24px;
    color: var(--text-dark);
    font-weight: 600;
    vertical-align: middle;
}

.description {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
    max-width: 700px;
    margin: 30px auto;
    padding: 0 20px;
    text-align: justify;
}

.certificate-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding: 0 40px;
}

.footer-left,
.footer-right {
    text-align: center;
}

.footer-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.footer-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.signature {
    width: 150px;
    height: 50px;
    border-bottom: 2px solid var(--cert-text);
    margin-top: 10px;
}

.serial-number {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.serial-number p {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 2px;
}

/* Download Actions */
.download-actions {
    max-width: 600px;
    margin: 30px auto;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #e55f00;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-icon {
    font-size: 20px;
}

/* Features Section */
.features {
    padding: 60px 0;
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.footer-tagline {
    font-style: italic;
    color: #ccc;
    margin-top: 10px;
}

.footer-section p {
    margin: 8px 0;
    font-size: 14px;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    color: #999;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .institute-name {
        font-size: 24px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .cert-title {
        font-size: 40px;
        letter-spacing: 4px;
    }
    
    .cert-subtitle {
        font-size: 24px;
    }
    
    .student-name {
        font-size: 32px;
    }
    
    .course-name {
        font-size: 24px;
    }
    
    .grade-display {
        font-size: 48px;
        width: 80px;
        height: 80px;
        line-height: 80px;
    }
    
    .certificate-footer {
        flex-direction: column;
        gap: 30px;
    }
    
    .download-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .certificate {
        padding: 20px;
    }
    
    .certificate-content {
        padding: 30px 20px;
    }
    
    .cert-title {
        font-size: 32px;
    }
    
    .student-name {
        font-size: 28px;
    }
    
    .description {
        font-size: 14px;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .certificate-section,
    .certificate-section * {
        visibility: visible;
    }
    
    .certificate-section {
        position: absolute;
        left: 0;
        top: 0;
    }
    
    .download-actions {
        display: none;
    }
}
