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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(-45deg, #004a99, #002854, #003d7a, #001f3f);
    background-size: 400% 400%;
    animation: gradientShift 45s ease infinite;
    min-height: 100vh;
    padding: 20px;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2em;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.import-section {
    margin-bottom: 30px;
}

.password-input-section {
    margin-bottom: 20px;
}

.password-input-section label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.password-input-section input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.password-input-section input[type="password"]:focus {
    outline: none;
    border-color: #003f7f;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #003f7f;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.instructions-box {
    background: #f0f5ff;
    border-left: 4px solid #003f7f;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.instructions-box h4 {
    margin-bottom: 12px;
    color: #003f7f;
    font-size: 1.1em;
}

.instructions-box ol {
    margin-left: 20px;
    line-height: 1.8;
}

.instructions-box li {
    margin-bottom: 8px;
    color: #333;
}

.file-upload {
    border: 3px dashed #003f7f;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload:hover:not(.disabled) {
    background: #f0f5ff;
    border-color: #002f5f;
}

.file-upload.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
}

.file-upload.disabled .file-upload-label {
    color: #999;
    cursor: not-allowed;
}

.file-upload input {
    display: none;
}

.file-upload-label {
    color: #003f7f;
    font-size: 1.1em;
    cursor: pointer;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.options-section {
    margin: 30px 0;
    padding: 20px;
    border-radius: 10px;
}

.options-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #003f7f;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 1em;
    color: #333;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

button {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: #003f7f;
    color: white;
}

.btn-primary:hover {
    background: #002f5f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 63, 127, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.preview-info {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 5px;
    display: none;
}

.preview-info.show {
    display: block;
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
        margin: 0;
    }

    .container {
        display: none;
    }

    .footer {
        display: none;
    }

    .print-area {
        display: block !important;
    }

    .page {
        margin: 0;
        padding: 5mm;
        height: auto;
        page-break-after: always;
        page-break-inside: avoid;
    }

    .page:last-child {
        page-break-after: avoid;
    }
}

.print-area {
    display: none;
}

.page {
    width: 210mm;
    padding: 5mm;
    background: white;
    margin: 0 auto;
    box-sizing: border-box;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 58mm);
    gap: 4mm;
}

.card {
    border: 2px dashed #ccc;
    border-radius: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.card-row {
    margin: 3px 0;
    word-wrap: break-word;
}

.card-label {
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
}

.card-value {
    font-size: 1em;
    color: #000;
    margin-top: 2px;
}

.error-message {
    background: #ffe7e7;
    border-left: 4px solid #dc3545;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    color: #721c24;
    display: none;
}

.error-message.show {
    display: block;
}

.btn-retry {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    background: #003f7f;
    color: white;
}

.btn-retry:hover {
    background: #002f5f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 63, 127, 0.4);
}

.footer {
    margin-top: 10px;
    padding: 15px 10px;
    text-align: center;
    color: white;
    font-size: 0.7em;
}

.footer .badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.footer .badges a {
    display: inline-block;
    transition: transform 0.2s, opacity 0.3s;
}

.footer .badges a:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

.footer .badges img {
    height: 20px;
    display: block;
}

.footer > a {
    color: white;
    text-decoration: none;
    font-size: 1em;
    transition: opacity 0.3s;
}

.footer > a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.page-number {
    text-align: center;
    margin-top: 5mm;
    font-size: 0.9em;
    color: #666;
}

.preview-section {
    margin-top: 30px;
    display: none;
}

.preview-section.show {
    display: block;
}

.preview-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.preview-container {
    max-height: 900px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f5f5f5;
}

.preview-container .page {
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-container .page:last-child {
    margin-bottom: 0;
}
