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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #f9fafb;
}

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

header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 5px;
}

header p {
    color: #6b7280;
    font-size: 14px;
}

.back-link {
    display: inline-block;
    color: #3b82f6;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 14px;
}

main {
    padding: 30px 0;
}

.hero {
    text-align: center;
    margin-bottom: 50px;
}

.hero h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #111827;
}

#examSearch {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 30px;
    transition: border-color 0.3s;
}

#examSearch:focus {
    outline: none;
    border-color: #3b82f6;
}

.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.exam-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    cursor: pointer;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.exam-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 500;
}

.exam-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #111827;
}

.exam-info {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #6b7280;
}

.features {
    margin: 60px 0;
}

.features h3 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.icon {
    font-size: 40px;
    display: block;
    margin-bottom: 15px;
}

.feature-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #111827;
}

.feature-card p {
    font-size: 14px;
    color: #6b7280;
}

.popular-exams {
    margin: 60px 0;
    text-align: center;
}

.popular-exams h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.exam-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag {
    padding: 8px 16px;
    background: #3b82f6;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.tag:hover {
    background: #2563eb;
}

.ad-slot {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.ad-placeholder {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    border-radius: 8px;
}

.ad-top .ad-placeholder {
    width: 728px;
    height: 90px;
    line-height: 50px;
}

.ad-bottom .ad-placeholder {
    width: 728px;
    height: 90px;
    line-height: 50px;
}

.ad-sidebar .ad-placeholder {
    width: 300px;
    height: 250px;
    line-height: 210px;
}

.tool-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #111827;
}

.doc-type-selector {
    display: flex;
    gap: 10px;
}

.doc-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.doc-btn:hover {
    border-color: #3b82f6;
}

.doc-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.requirements {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.req-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #dbeafe;
}

.req-item:last-child {
    border-bottom: none;
}

.req-label {
    font-weight: 500;
    color: #1e40af;
}

.req-value {
    color: #1e3a8a;
    font-weight: 600;
}

.upload-zone {
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9fafb;
}

.upload-zone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-zone.drag-over {
    border-color: #3b82f6;
    background: #dbeafe;
}

.upload-icon {
    font-size: 50px;
    display: block;
    margin-bottom: 15px;
}

.upload-content p {
    font-size: 16px;
    color: #374151;
    margin-bottom: 5px;
}

.upload-content small {
    color: #6b7280;
    font-size: 14px;
}

.loading {
    font-size: 16px;
    color: #3b82f6;
    padding: 50px;
    text-align: center;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.preview-card {
    position: sticky;
    top: 100px;
}

.preview-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.preview-box {
    flex: 1;
    text-align: center;
}

.preview-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.preview-box canvas {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.file-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

.preview-arrow {
    font-size: 24px;
    color: #9ca3af;
}

.status-badge {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    margin-bottom: 20px;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.btn-download {
    width: 100%;
    padding: 15px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 10px;
}

.btn-download:hover {
    background: #2563eb;
}

.btn-download:active {
    transform: scale(0.98);
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.placeholder-content {
    text-align: center;
    padding: 80px 20px;
    color: #9ca3af;
}

.placeholder-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
}

footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 30px 0;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-top: 60px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    main {
        padding: 15px 0;
    }
    
    .tool-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .doc-type-selector {
        flex-direction: column;
        gap: 8px;
    }
    
    .doc-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .preview-container {
        flex-direction: column;
    }
    
    .preview-arrow {
        transform: rotate(90deg);
    }
    
    .ad-top .ad-placeholder,
    .ad-bottom .ad-placeholder {
        width: 100%;
        max-width: 320px;
        height: 50px;
        line-height: 10px;
        font-size: 12px;
    }
    
    .ad-sidebar {
        display: none;
    }
    
    .exam-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 22px;
    }
    
    .upload-zone {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 40px;
    }
}

/* Language Toggle Switch */
.lang-toggle {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #3b82f6;
}

input:checked + .slider:before {
    transform: translateX(23px);
}

/* Responsive header for language toggle */
@media (max-width: 768px) {
    header {
        padding: 15px 0;
    }
    
    header .container {
        padding: 0 10px;
        gap: 10px;
    }
    
    header .container > div:first-child {
        flex: 1;
        min-width: 0;
        gap: 8px !important;
        max-width: calc(100% - 120px);
    }
    
    header .container > div:first-child img {
        height: 40px !important;
        flex-shrink: 0;
    }
    
    header h1 {
        font-size: 14px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .back-link {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .lang-toggle {
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .lang-toggle span {
        font-size: 10px !important;
        margin-right: 5px !important;
        white-space: nowrap;
    }
    
    .switch {
        width: 40px !important;
        height: 20px !important;
    }
    
    .slider:before {
        height: 14px !important;
        width: 14px !important;
        left: 3px !important;
        bottom: 3px !important;
    }
    
    input:checked + .slider:before {
        transform: translateX(17px) !important;
    }
}
