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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f0f3f6 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #212529;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

body.modal-open > *:not(.login-modal) {
    display: none !important;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeInModal 0.4s ease-out forwards;
}

.login-modal.hiding {
    animation: bounceOut 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bounceOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

.login-modal-content {
    background: white;
    border-radius: 20px;
    padding: 3rem 3.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideInModal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.login-modal.hiding .login-modal-content {
    animation: bounceOutContent 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounceOutContent {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.15);
    }
    100% {
        transform: translateY(100px) scale(0.7);
        opacity: 0;
    }
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #212529;
    margin-bottom: 2.5rem;
    letter-spacing: -0.5px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.password-input {
    padding: 1rem 1.25rem;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

.password-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.login-prepared-for {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.login-hyundai-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* Header */
.header {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.uc-logo {
    max-width: 220px;
    height: auto;
    object-fit: contain;
}

.header-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #212529;
    margin: 0;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.prepared-for {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.hyundai-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Thumbnail Section */
.thumbnail-section {
    margin-bottom: 3rem;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.thumbnail-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.thumbnail-item:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.thumbnail-item.active {
    border-color: #0d6efd;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.2);
}

.thumbnail-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.thumbnail-label {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: #212529;
    font-size: 1rem;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

/* Details Section */
.details-section {
    position: relative;
    margin-bottom: 3rem;
}

.details-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
}

.details-wrapper.animate-in {
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.room-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.room-name {
    font-size: 2.25rem;
    color: #212529;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 1.5rem 0;
}

.image-and-totals {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: start;
}

.image-container {
    display: flex;
    align-items: flex-start;
}

.room-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    align-self: flex-start;
}

.info-panel {
    width: 100%;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.room-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    background: white;
}

.room-table thead {
    background: #f8f9fa;
}

.room-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.15s ease;
}

.room-table tbody tr.animate-in {
    animation: fadeInRow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeInRow {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.room-table tbody tr:hover {
    background: #f8f9fa;
}

.room-table tbody tr:last-child {
    border-bottom: none;
}

.room-table td {
    padding: 1rem;
    vertical-align: top;
    color: #495057;
}

.room-table td:nth-child(1) {
    text-align: center;
    font-weight: 600;
    color: #212529;
}

.room-table td:nth-child(4) {
    max-width: 400px;
    line-height: 1.5;
}

.room-table td:nth-child(5),
.room-table td:nth-child(6) {
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
}

.totals-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 250px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    justify-self: center;
}

.total-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.total-row:not(:first-child) {
    border-top: 1px solid #e9ecef;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.total-label {
    font-weight: 400;
    text-transform: none;
    color: #495057;
    font-size: 0.95rem;
}

.total-value {
    font-weight: 700;
    color: #212529;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: flex-start;
}

.total-value .dollar-sign {
    font-size: 1rem;
    vertical-align: top;
    margin-right: 2px;
}

.mobile-items-list {
    display: none;
}

.mobile-item-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.mobile-item-card.animate-in {
    animation: fadeInRow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.mobile-item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.mobile-item-qty {
    font-weight: 700;
    font-size: 1.1rem;
    color: #212529;
}

.mobile-item-mfg-model {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.mobile-item-description {
    margin: 0.75rem 0;
    color: #495057;
    line-height: 1.5;
}

.mobile-item-prices {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.mobile-item-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-item-price-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-item-price-value {
    font-weight: 600;
    color: #212529;
}


/* Footer */
.footer {
    background: #212529;
    padding: 4rem 2rem;
    margin-top: 4rem;
}

.contact-cards {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: white;
    color: #212529;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
}

.contact-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #212529;
}

.contact-email {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    display: inline-block;
}

.contact-email:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left {
        width: 100%;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .uc-logo {
        max-width: 180px;
    }

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

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .hyundai-logo {
        height: 50px;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }

    .thumbnail-image {
        height: 120px;
    }

    .thumbnail-label {
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
    }

    .details-wrapper {
        padding: 1.5rem;
    }

    .room-display {
        flex-direction: column;
    }

    .room-name {
        font-size: 1.75rem;
    }

    .room-image {
        max-height: 350px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1.5rem;
        padding: 0 1.5rem;
    }

    .room-table {
        display: none;
    }

    .mobile-items-list {
        display: block;
    }

    .image-and-totals {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .totals-section {
        min-width: auto;
    }

    .footer {
        padding: 3rem 1.5rem;
    }

    .contact-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.25rem;
    }

    .thumbnails {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .thumbnail-image {
        height: 100px;
    }

    .room-name {
        font-size: 1.5rem;
    }

    .room-table {
        display: none;
    }

    .mobile-items-list {
        display: block;
    }
}

/* Print Styles */
@media print {
    /* Hide login modal, thumbnails, and original header */
    .login-modal,
    .thumbnail-section,
    .header:not(.print-header) {
        display: none !important;
    }

    /* Reset body for print */
    body {
        background: white;
        color: black;
    }

    /* Header for print - appears on each page */
    @page {
        margin-top: 0;
        margin-bottom: 40px;
    }

    .header.print-header {
        position: static;
        background: white;
        box-shadow: none;
        border-bottom: 1px solid #ddd;
        padding: 0.75rem 1rem;
        margin: 0;
        page-break-inside: avoid;
        page-break-after: avoid;
        width: 100%;
    }

    .header.print-header .header-content {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .header-content {
        max-width: 100%;
        margin: 0;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .uc-logo {
        max-width: 150px;
    }

    .hyundai-logo {
        height: 40px;
    }

    /* Main content spacing for header */
    .main-content {
        margin-top: 0;
        padding: 1rem;
        max-width: 100%;
    }

    /* Each room on its own page */
    .details-section {
        page-break-inside: auto;
    }

    .details-wrapper {
        box-shadow: none;
        border-bottom: 1px solid #ddd;
        border-left: none;
        border-right: none;
        border-top: none;
        padding: 0;
        page-break-inside: auto;
    }

    .room-page {
        page-break-before: always;
        page-break-inside: avoid;
        margin: 0;
        padding: 0;
        min-height: 0;
    }

    .room-page:first-of-type {
        page-break-before: auto;
    }

    .room-page .print-header {
        margin-bottom: 1rem;
    }

    .room-page .room-name {
        font-size: 1.75rem;
        margin: 0 0 1.5rem 0;
        padding: 0 1.5rem;
        display: block;
        color: #212529;
        font-weight: 700;
        page-break-after: avoid;
        page-break-before: avoid;
    }

    .room-display {
        gap: 1.5rem;
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    
    .room-page .room-display {
        page-break-inside: avoid;
    }

    .image-and-totals {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    .room-image {
        max-height: 400px;
    }

    /* Table styling for print */
    .room-table {
        font-size: 0.8rem;
        page-break-inside: auto;
    }

    .room-table thead {
        display: table-header-group;
    }

    .room-table thead tr {
        page-break-inside: avoid;
        page-break-after: avoid;
    }

    .room-table tbody tr {
        page-break-inside: avoid;
    }

    .room-table th,
    .room-table td {
        padding: 0.5rem;
    }

    .totals-section {
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
        border-left: none;
        border-right: none;
        padding: 1rem;
    }

    .total-value {
        font-size: 1.25rem;
    }

    /* Hide mobile items list in print */
    .mobile-items-list {
        display: none !important;
    }

    /* Footer/Contact info on last page */
    .footer {
        page-break-before: always;
        background: white;
        color: black;
        padding: 0;
        margin-top: 0;
    }

    .footer .header.print-header {
        margin-bottom: 1rem;
    }

    .contact-cards {
        max-width: 100%;
        page-break-inside: avoid;
        margin-top: 4rem;
        padding: 0;
    }

    .contact-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        padding: 2.5rem;
    }

    .contact-card .contact-icon {
        display: flex !important;
        width: 48px !important;
        height: 48px !important;
        background: #667eea !important;
        background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        border-radius: 50% !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 1.5rem !important;
        color: white !important;
    }
    
    .contact-card .contact-icon svg {
        display: block !important;
        width: 24px !important;
        height: 24px !important;
    }

    .contact-card:hover {
        transform: none;
        box-shadow: none;
    }

    .contact-email {
        color: black;
        text-decoration: underline;
    }

    /* Remove animations and transitions */
    * {
        animation: none !important;
        transition: none !important;
    }

    /* Ensure proper page breaks */
    .info-panel {
        page-break-inside: auto;
    }
}
