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

body {
    font-family: 'Lato', sans-serif;
    background: #FDF8F3;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content {
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.header-top .logo {
    max-width: 180px;
    margin-bottom: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.header-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    font-size: 1em;
}

.header-button-admin {
    background: #c29f5d;
    color: white;
}

.header-button-logout {
    background: #dc3545;
    color: white;
}

.logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

/* Ensure all form elements use Lato font */
input, select, textarea, button {
    font-family: 'Lato', sans-serif;
}

input::placeholder, textarea::placeholder {
    font-family: 'Lato', sans-serif;
}

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

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.upload-section {
    margin-bottom: 40px;
}

.dropzone {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.dropzone:hover, .dropzone.dragover {
    background: #e9ecef;
    border-color: #764ba2;
}

.dropzone-content {
    pointer-events: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: #667eea;
    margin-bottom: 20px;
}

.dropzone h3 {
    color: #333;
    margin-bottom: 10px;
}

.dropzone p {
    color: #666;
}

.config-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.config-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.config-section input {
    width: 100%;
    max-width: 200px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
}

.upload-button {
    width: 100%;
    padding: 15px 30px;
    background: #B49D75;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 20px;
}

.upload-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.upload-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.estimate-options {
    display: flex;
    gap: 30px;
    margin: 40px 0 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.option-group {
    flex: 1;
    min-width: 250px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.option-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.option-group select:hover {
    border-color: #B49D75;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
}

.cost-estimate {
    flex: 1;
    min-width: 280px;
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #B49D75;
}

.cost-estimate h3 {
    color: #03394E;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.estimate-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #d1e3f5;
}

.estimate-row:last-child {
    border-bottom: none;
}

.estimate-label {
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.estimate-value {
    color: #03394E;
    font-weight: 600;
    font-size: 1.05em;
}

.loading-indicator {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    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); }
}

.results-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.total-pages {
    text-align: center;
}

.total-pages h2 {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.total-count {
    font-size: 4em;
    font-weight: bold;
    color: #667eea;
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-button {
    padding: 10px 20px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    background: #667eea;
    color: white;
}

.warnings {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.warnings h4 {
    color: #856404;
    margin-bottom: 10px;
}

.warnings ul {
    list-style-position: inside;
    color: #856404;
}

.breakdown {
    margin-top: 30px;
}

.breakdown h3 {
    color: #333;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th, td {
    padding: 15px;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid #dee2e6;
}

tbody tr:hover {
    background: #f8f9fa;
}

.status-ok {
    color: #28a745;
    font-weight: 600;
}

.status-error, .status-encrypted, .status-skipped {
    color: #dc3545;
    font-weight: 600;
}

.estimated-badge {
    background: #17a2b8;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 5px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px 15px;
        border-radius: 8px;
    }

    header {
        margin-bottom: 30px;
    }

    .header-content {
        width: 100%;
        text-align: center;
        margin-top: 15px;
    }

    .header-buttons {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end !important;
        margin-bottom: 15px;
    }

    .header-button {
        padding: 12px 24px;
        font-size: 0.95em;
    }

    h1 {
        font-size: 1.5em;
        line-height: 1.3;
    }

    .logo {
        max-width: 200px;
    }

    .dropzone {
        padding: 40px 15px;
    }

    .upload-icon {
        width: 60px;
        height: 60px;
    }

    .dropzone h3 {
        font-size: 1.1em;
    }

    .dropzone p {
        font-size: 0.9em;
    }

    .estimate-options {
        flex-direction: column;
        gap: 20px;
        padding: 20px 15px;
        margin: 30px 0 15px 0;
    }

    .option-group {
        min-width: 100%;
    }

    .cost-estimate {
        min-width: 100%;
    }

    .config-section {
        padding: 15px;
        margin: 20px 0;
    }

    .config-section input {
        max-width: 100%;
    }

    .url-input-section input {
        font-size: 0.95em;
    }

    .url-input-section button {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .upload-button {
        padding: 15px;
        font-size: 1em;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
    }

    .total-pages h2 {
        font-size: 1em;
    }

    .total-count {
        font-size: 2.5em;
    }

    .results-actions {
        width: 100%;
        justify-content: center;
    }

    .action-button {
        flex: 1;
        text-align: center;
    }

    .breakdown h3 {
        font-size: 1.2em;
    }

    table {
        font-size: 0.85em;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    thead {
        display: table-header-group;
    }

    th, td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    .estimate-details {
        gap: 8px;
    }

    .estimate-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 10px 0;
    }

    .estimate-label,
    .estimate-value {
        font-size: 0.9em;
    }
}
