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

body {
    font-family: 'Arial', sans-serif;
    background: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%),
        url('background.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 
        2px 2px 8px rgba(0,0,0,0.8),
        0 0 30px rgba(255,255,255,0.5);
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.7));
}

/* Form Section */
.form-section {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3),
        0 1px 0 rgba(255,255,255,0.8) inset;
    border: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.button-group button {
    flex: 1;
    min-width: 180px;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#generateBtn {
    background: linear-gradient(135deg, #FF6600, #FF8C42);
    color: white;
}

#generateBtn:hover {
    background: linear-gradient(135deg, #E55A00, #FF7A2E);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
}

#downloadBtn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

#downloadBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838, #1abc9c);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

#downloadBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}


/* Certificate Section */
.certificate-section {
    display: none;
    justify-content: center;
    margin-top: 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.certificate {
    width: 800px;
    height: 600px;
    position: relative;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Certificate Background Image */
.certificate-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Name Overlay */
.name-overlay {
    position: absolute;
    top: 58.5%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 0 40px;
}

.participant-name {
    font-size: 1.2rem;
    font-weight: 100;
    color: #000;
    display: inline-block;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: auto;
    }
    
    .container {
        padding: 10px;
        max-width: none;
    }
    
    .certificate-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0;
    }
    
    .certificate {
        width: 800px;
        height: 600px;
        min-width: 800px;
        min-height: 600px;
        max-width: none;
        max-height: none;
        margin: 0 auto;
        border-radius: 15px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.1);
        overflow: visible;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .certificate-background {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
    }
    
    .name-overlay {
        position: absolute;
        top: 58.5%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
        text-align: center;
        width: 100%;
        padding: 0 40px;
    }
    
    .participant-name {
        font-size: 1.5rem;
        font-weight: 100;
        color: #000;
        display: inline-block;
        text-align: center;
        font-family: 'Roboto', sans-serif;
        letter-spacing: 2px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .form-section {
        display: none;
    }
    
    .certificate {
        width: 100%;
        height: auto;
        box-shadow: none;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .certificate-background {
        width: 100%;
        height: auto;
    }
}
