.masthead {
    background-color: var(--primary-color);
    color: white;
    padding: 5rem 0;
}

.masthead h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.masthead .lead {
    font-size: 1.2rem;
    font-weight: 300;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.section {
    padding: 4rem 0;
}

.section:nth-child(even) {
    background-color: white;
}

.section:nth-child(odd) {
    background-color: var(--primary-color);
    color: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.collapse-btn {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.collapse-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsed {
    max-height: 0 !important;
}

.instructions {
    background: var(--secondary-color);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    border: none;
}

.instructions strong {
    color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.title-input,
.author-input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    font-size: 1.2rem;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.9);
    color: var(--dark-color);
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
}

.title-input {
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

.author-input {
    font-style: italic;
}

.title-input:focus,
.author-input:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.9);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 180px;
}

.checkbox-inline:hover {
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-inline label {
    font-weight: 500;
    color: var(--dark-color);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Lato', sans-serif;
    margin: 0;
    white-space: nowrap;
}

.checkbox-label-text {
    color: #2c3e50 !important;
    font-weight: normal !important;
    text-transform: none !important;
}

.text-input {
    width: 100%;
    min-height: 300px;
    padding: 25px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    background: rgba(255,255,255,0.9);
    color: var(--dark-color);
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.controls {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    justify-content: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: white;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select,
input[type="number"] {
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255,255,255,0.9);
    color: var(--dark-color);
    transition: all 0.3s ease;
    font-family: 'Lato', sans-serif;
}

select:focus,
input[type="number"]:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.font-select {
    min-width: 180px;
}

.size-input {
    width: 80px;
}

.btn {
    padding: 15px 30px;
    border: 2px solid;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: transparent;
    border-color: white;
    color: white;
}

.btn-primary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-success {
    background: transparent;
    border-color: white;
    color: white;
}

.btn-success:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.pages-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

.pages-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    padding: 30px;
    min-width: fit-content;
}

.page {
    width: 1050px;
    height: 743px;
    background: white;
    border: 2px solid #333;
    display: flex;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.page-label {
    position: absolute;
    top: -35px;
    left: 0;
    color: white;
    padding: 5px 15px;
    border-radius: 5px 5px 0 0;
    font-weight: bold;
}

.column {
    flex: 1;
    padding: 20px 12px 30px 12px;
    border-right: 1px solid #333;
    font-family: var(--selected-font, 'Times New Roman');
    font-size: var(--selected-size, 11px);
    line-height: var(--selected-line-height, 1.2);
    text-align: justify;
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
    height: 100%;
}

.column:last-child {
    border-right: none;
}

.column p {
    margin-bottom: 0;
    text-indent: 0;
}

.column p + p {
    margin-top: 0.8em;
}

.column .title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 0.5em;
    text-align: left;
}

.column .author {
    font-size: 1em;
    font-style: italic;
    margin-bottom: 1.5em;
    text-align: left;
    color: #555;
}

.pdf-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.pdf-loader .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pdf-loader p {
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.download-area {
    padding: 4rem 0;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
}

.download-area p {
    font-size: 1.1rem;
    margin: 2rem 0;
    font-weight: 400;
}

.download-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.zoom-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.zoom-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: white;
    color: var(--secondary-color);
    transform: scale(1.1);
}

.zoom-label {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    min-width: 50px;
    justify-content: center;
}

@media (max-width: 1200px) {
    .pages-container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .masthead h1 {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .controls {
        gap: 15px;
        flex-direction: column;
        align-items: center;
    }

    .control-group {
        width: 100%;
        max-width: 280px;
    }

    .font-select,
    select,
    input[type="number"] {
        width: 100%;
    }

    .checkbox-inline {
        justify-content: center;
        min-width: auto;
        width: 100%;
        max-width: 280px;
    }

    .download-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .masthead {
        padding: 3rem 0;
    }

    .masthead h1 {
        font-size: 1.8rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .title-input,
    .author-input,
    .text-input {
        font-size: 16px;
    }

    .instructions {
        font-size: 0.9rem;
        padding: 1.5rem;
    }
}
