/* Weekly Timesheet Calculator Styles */

.weekly-timesheet-calculator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.weekly-timesheet-calculator h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.intro-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 2rem;
}

/* Calculator Card */
.calculator-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

.section-title svg {
    width: 28px;
    height: 28px;
    color: #0066cc;
}

/* Employee Info Section */
.employee-info-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.input-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.input-field input[type="text"],
.input-field input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-field input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Hours Entry Section */
.hours-entry-section {
    margin-bottom: 2rem;
}

.format-hint {
    background: #e3f2fd;
    border-left: 4px solid #0066cc;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
    color: #555;
}

.timesheet-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.timesheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.timesheet-table thead {
    background: #f8f9fa;
}

.timesheet-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.timesheet-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.timesheet-table tbody tr:hover {
    background: #f8f9fa;
}

.day-name {
    font-weight: 600;
    color: #1a1a1a;
}

.day-date {
    color: #666;
}

.hours-input,
.notes-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95rem;
}

.hours-input {
    max-width: 120px;
}

.notes-input {
    min-width: 150px;
}

.hours-input:focus,
.notes-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Results Section */
.results-section {
    margin-top: 3rem;
}

.results-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid #0066cc;
}

.print-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.print-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.print-logo img {
    height: 40px;
    width: 40px;
}

.print-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0066cc;
}

.print-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

.print-title p {
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 1rem;
}

/* Employee Info Display */
.employee-info-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item .label {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
}

.info-item .value {
    font-size: 1rem;
    color: #1a1a1a;
}

/* Summary Table */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.summary-table thead {
    background: #f8f9fa;
}

.summary-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.summary-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.summary-table tfoot {
    background: #f0f8ff;
}

.summary-table .total-row td {
    padding: 1rem 0.75rem;
    font-size: 1.1rem;
    border-top: 3px solid #0066cc;
    border-bottom: none;
}

.notes-cell {
    font-size: 0.9rem;
    color: #666;
}

/* Signature Section */
.print-signature-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 3rem 0 2rem 0;
    padding: 2rem 0;
    border-top: 2px solid #e9ecef;
}

.signature-line {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.signature-line span {
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signature-underline {
    border-bottom: 2px solid #333;
    height: 50px;
    position: relative;
}

.signature-underline::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 1px;
    background: #999;
}

/* Results Footer */
.results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 1rem;
}

.timestamp {
    color: #666;
    font-size: 0.9rem;
}

.print-actions {
    display: flex;
    gap: 1rem;
}

.print-footer-section {
    display: none;
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 2px solid #e9ecef;
    color: #666;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.print-branding {
    display: block;
    margin-bottom: 0.5rem;
}

/* SEO Content */
.seo-content {
    max-width: 800px;
    margin: 4rem auto 2rem auto;
    padding: 2rem;
    line-height: 1.8;
}

.seo-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: #1a1a1a;
}

.seo-content p {
    margin-bottom: 1rem;
    color: #555;
}

.steps-list,
.features-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.steps-list li,
.features-list li {
    margin-bottom: 0.75rem;
    color: #555;
}

.faq-section {
    margin-top: 2rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.faq-question {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.faq-answer {
    color: #555;
    line-height: 1.7;
}

.cta-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    border-radius: 12px;
    margin-top: 3rem;
    color: white;
}

.cta-section h2 {
    color: white;
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
}

/* Print Styles - CSS-Only Architecture */
@media print {
    /* Page Setup */
    @page {
        size: letter landscape;
        margin: 0.4in;
    }

    /* Force Print Colors */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Reset Body & HTML */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        overflow: visible !important;
    }

    /* Hide Layout Structure */
    header, footer, nav,
    .header, .footer, .navigation,
    [role="navigation"],
    [role="banner"],
    [role="contentinfo"] {
        display: none !important;
    }

    /* Hide Screen Content */
    .weekly-timesheet-calculator h1,
    .intro-text,
    .calculator-card,
    .form-actions,
    .seo-content {
        display: none !important;
    }

    /* CRITICAL: Hide Print Button */
    .print-actions,
    .btn-success,
    button {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide Container Padding/Margins */
    .container,
    .container-fluid,
    .container-md-80,
    #content {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Hide Everything, Then Show Only Timesheet */
    body > * {
        display: none !important;
    }

    body > .container-fluid {
        display: block !important;
    }

    .container-fluid > * {
        display: none !important;
    }

    .container-fluid > main {
        display: block !important;
    }

    main > * {
        display: none !important;
    }

    main > .weekly-timesheet-calculator {
        display: block !important;
    }

    .weekly-timesheet-calculator > * {
        display: none !important;
    }

    .weekly-timesheet-calculator > #resultsSection {
        display: block !important;
    }

    /* Show Printable Content */
    #resultsSection {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #resultsSection * {
        display: revert !important;
    }

    /* But explicitly hide buttons again */
    #resultsSection button,
    #resultsSection .btn,
    #resultsSection .print-actions {
        display: none !important;
        visibility: hidden !important;
    }

    #printableContent {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Remove All Rounded Corners & Borders */
    * {
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* Print Header - Reduced Spacing */
    .results-header {
        display: block !important;
        padding: 8px 12px 10px 12px !important;
        border-bottom: 2px solid #000;
        margin-bottom: 10px;
        page-break-after: avoid;
    }

    .print-header-row {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
    }

    .print-logo {
        display: flex !important;
        align-items: center;
        gap: 6px;
        padding-right: 12px;
    }

    .print-logo img {
        width: 22px;
        height: auto;
    }

    .print-logo span {
        font-size: 13px;
        font-weight: 700;
        color: #000;
    }

    .print-title {
        text-align: right;
        padding-left: 12px;
    }

    .print-title h2 {
        font-size: 15px !important;
        font-weight: 700 !important;
        color: #000 !important;
        margin: 0 !important;
    }

    .print-title p {
        font-size: 10px !important;
        color: #333 !important;
        margin: 2px 0 0 0 !important;
    }

    /* Print Body - Reduced Spacing */
    .results-body {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Employee Info - Reduced Spacing */
    .employee-info-display {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px 12px;
        padding: 8px;
        background: #f5f5f5 !important;
        border: 1px solid #999 !important;
        margin-bottom: 8px;
        page-break-inside: avoid;
    }

    .info-item {
        display: flex !important;
        gap: 5px;
        font-size: 9px !important;
    }

    .info-item .label {
        font-weight: 700 !important;
        color: #000 !important;
    }

    .info-item .value {
        color: #333 !important;
    }

    /* Section Headers - Reduced Spacing */
    .section-title {
        font-size: 10px !important;
        font-weight: 700 !important;
        color: #000 !important;
        margin: 8px 0 5px 0 !important;
    }

    .section-title svg {
        display: none !important;
    }

    /* Summary Table - Reduced Spacing */
    .summary-table {
        display: table !important;
        width: 100%;
        border-collapse: collapse;
        font-size: 8.5px !important;
        page-break-inside: avoid;
        margin-bottom: 8px;
    }

    .summary-table thead {
        display: table-header-group !important;
    }

    .summary-table tbody {
        display: table-row-group !important;
    }

    .summary-table tfoot {
        display: table-footer-group !important;
    }

    .summary-table tr {
        display: table-row !important;
        page-break-inside: avoid;
    }

    .summary-table th {
        display: table-cell !important;
        background: #333 !important;
        color: #fff !important;
        padding: 5px;
        text-align: left;
        font-weight: 700 !important;
        border: 1px solid #333 !important;
    }

    .summary-table td {
        display: table-cell !important;
        padding: 4px 5px;
        border: 1px solid #999 !important;
        color: #000 !important;
    }

    .summary-table tbody tr:nth-child(even) {
        background: #f9f9f9 !important;
    }

    .summary-table tfoot tr {
        background: #f0f8ff !important;
    }

    .summary-table .total-row td {
        padding: 6px 5px !important;
        font-size: 9.5px !important;
        font-weight: 700 !important;
        border-top: 3px solid #000 !important;
    }

    .notes-cell {
        font-size: 7.5px !important;
        color: #666 !important;
    }

    /* Signatures - Reduced Spacing */
    .print-signature-section {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-top: 15px;
        padding-top: 10px;
        border-top: 1px solid #999;
        page-break-inside: avoid;
    }

    .signature-line {
        display: flex !important;
        flex-direction: column;
        gap: 3px;
    }

    .signature-line span {
        display: block !important;
        font-size: 7.5px !important;
        font-weight: 700 !important;
        color: #333 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }

    .signature-underline {
        border-bottom: 2px solid #000 !important;
        height: 30px;
        margin-top: 3px;
    }

    .signature-underline::after {
        display: none !important;
    }

    /* Footer - Reduced Spacing */
    .results-footer {
        margin-top: 10px;
        padding: 8px 12px 6px 12px !important;
        border-top: 1px solid #999 !important;
    }

    .timestamp {
        display: block !important;
        font-size: 6.5px !important;
        color: #666 !important;
        text-align: center;
        margin-bottom: 5px;
    }

    .print-footer-section {
        display: flex !important;
        justify-content: space-between;
        font-size: 6.5px !important;
        color: #666 !important;
        padding: 0 4px !important;
        margin-top: 5px;
    }

    .print-branding {
        font-weight: 700 !important;
        color: #000 !important;
    }

    /* Ensure Single Page */
    .weekly-timesheet-calculator {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .results-card {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .results-section {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Force single page */
    .results-body {
        page-break-after: avoid !important;
    }

    .summary-table {
        page-break-after: avoid !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .weekly-timesheet-calculator {
        padding: 1rem;
    }

    .weekly-timesheet-calculator h1 {
        font-size: 2rem;
    }

    .calculator-card,
    .results-card {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .timesheet-table,
    .summary-table {
        font-size: 0.85rem;
    }

    .timesheet-table th,
    .timesheet-table td,
    .summary-table th,
    .summary-table td {
        padding: 0.5rem 0.25rem;
    }

    .hours-input {
        max-width: 90px;
    }

    .results-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .print-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .print-signature-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
