/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --border-radius: 10px;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--box-shadow);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 80px;
    width: auto;
}

.logo-text h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
    color: white;
}

.logo-text h2 {
    font-size: 1.2em;
    color: var(--secondary-color);
    font-weight: normal;
}

.header-info {
    display: flex;
    gap: 30px;
    margin-top: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

/* ===== PROGRESS STEPS ===== */
.progress-section {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
    transition: var(--transition);
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--secondary-color);
}

.step-text {
    font-weight: 500;
    font-size: 0.9em;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: 40px 0;
    min-height: 60vh;
}

.step-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CARD COMPONENTS ===== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

.card-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
    padding: 25px 30px;
}

.card-header h3 {
    margin-bottom: 5px;
    font-size: 1.5em;
}

.card-body {
    padding: 30px;
}

/* ===== UPLOAD SECTION ===== */
.upload-container {
    text-align: center;
}

.upload-area {
    border: 3px dashed var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    background: #f8f9fa;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 30px;
}

.upload-area:hover {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.upload-area h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.upload-preview {
    margin-top: 30px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 20px 0;
}

.preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.upload-tips {
    background: #e8f4fc;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 30px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tip-icon {
    font-size: 1.2em;
}

/* ===== FORM STYLES ===== */
.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.8em;
    color: var(--gray-color);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ===== BUTTON STYLES ===== */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
}

/* ===== SUCCESS MESSAGE ===== */
.success-message {
    text-align: center;
    padding: 30px;
    background: #e8f6f3;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

/* ===== E-KTA PREVIEW ===== */
.ekta-preview-container {
    margin: 30px 0;
}

.ekta-preview {
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    font-family: 'Arial', sans-serif;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.ekta-preview::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color), var(--secondary-color));
}

.ekta-header {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.ekta-logo {
    height: 80px;
    margin-right: 20px;
}

.ekta-title {
    flex: 1;
}

.ekta-title h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.8em;
    font-weight: bold;
}

.ekta-title h3 {
    color: var(--secondary-color);
    margin: 5px 0 0 0;
    font-size: 1.3em;
}

.ekta-body {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.ekta-photo {
    flex: 0 0 120px;
    text-align: center;
}

.photo-placeholder {
    width: 120px;
    height: 150px;
    border: 2px dashed #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    border-radius: 8px;
    color: #7f8c8d;
    font-size: 14px;
}

.ekta-details {
    flex: 1;
}

.detail-item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.detail-item label {
    font-weight: bold;
    min-width: 180px;
    color: var(--primary-color);
    font-size: 14px;
    margin: 0;
}

.detail-item span {
    flex: 1;
    color: #34495e;
    font-size: 14px;
    border-bottom: 1px dotted #bdc3c7;
    padding-bottom: 2px;
}

.ekta-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 2px solid #ecf0f1;
    padding-top: 20px;
    margin-top: 20px;
}

.valid-until {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 14px;
}

.signature {
    text-align: center;
}

.signature-line {
    width: 200px;
    border-top: 1px solid var(--primary-color);
    margin-bottom: 5px;
}

.signature div {
    font-size: 12px;
    color: #7f8c8d;
}

/* Watermark */
.ekta-preview::after {
    content: "PPP DIGITAL";
    position: absolute;
    bottom: 50px;
    right: 30px;
    font-size: 60px;
    color: rgba(52, 152, 219, 0.1);
    font-weight: bold;
    transform: rotate(-45deg);
    pointer-events: none;
}

/* QR Code Area */
.qr-code {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
}

.qr-code::before {
    content: "QR Code";
    font-size: 10px;
    color: #7f8c8d;
}

.download-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

.next-steps {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

.next-steps h5 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.next-steps ul {
    list-style: none;
    padding: 0;
}

.next-steps li {
    padding: 5px 0;
    position: relative;
    padding-left: 25px;
}

.next-steps li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h4 {
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo-section {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .header-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .progress-steps {
        gap: 20px;
    }
    
    .step-text {
        font-size: 0.8em;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .download-actions {
        flex-direction: column;
    }
    
    .ekta-body {
        flex-direction: column;
        gap: 20px;
    }
    
    .ekta-photo {
        align-self: center;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .detail-item label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 3em;
    }
    
    .ekta-preview {
        padding: 20px;
    }
    
    .ekta-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .ekta-logo {
        margin-right: 0;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
.visible { display: block; }

/* ===== PRINT STYLES ===== */
@media print {
    .header, .footer, .progress-section, .form-actions, .download-actions {
        display: none !important;
    }
    
    .ekta-preview {
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    body {
        background: white;
    }
}
/* ===== CAMERA STYLES ===== */
.input-methods {
    margin-bottom: 30px;
}

.method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.method-tab {
    padding: 12px 20px;
    background: #f8f9fa;
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.method-tab.active {
    background: #3498db;
    color: white;
}

.method-tab:hover:not(.active) {
    background: #e9ecef;
}

.method-content {
    display: none;
}

.method-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Camera Specific Styles */
.camera-area {
    border: 3px dashed #27ae60;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
}

.camera-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: #27ae60;
}

.camera-preview {
    margin: 20px 0;
    text-align: center;
}

#videoElement {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#capturedImage {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.camera-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.photo-preview {
    margin-top: 20px;
}

/* Drag & Drop Enhanced */
.dragdrop-area {
    border: 3px dashed #e74c3c;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dragdrop-area.dragover {
    background: #ffeaa7;
    border-color: #f39c12;
}

.dragdrop-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: #e74c3c;
}

.dragdrop-hint {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 10px;
}

/* Shared Preview */
.shared-preview {
    margin-top: 30px;
    text-align: center;
}

.shared-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin: 20px 0;
}

/* Mobile Camera Optimization */
@media (max-width: 768px) {
    .method-tabs {
        flex-direction: column;
    }
    
    .camera-area, .dragdrop-area {
        padding: 30px 20px;
    }
    
    #videoElement, #capturedImage {
        max-height: 300px;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
}

/* Camera Permission Styles */
.camera-permission {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.camera-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
    color: #721c24;
}