:root {
    background-color: #333333;
    --primary-color: #1976d2;
    --success-color: #388e3c;
    --warning-color: #d32f2f;
    --border-color: #e0e0e0;
    --background-color: #ffffff;
    --card-background: #ffffff;
    --section-background: #f8f9fa;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    font-size: .85rem;
}

h1, h2, h3, h4, h5 {
    margin-bottom: 1.4rem;
    margin-top: 1.4rem;
    line-height: 1.7;

}

h1:first-of-type {
    margin-top: 0;
}

p, ol, ul, table {
    margin-bottom: 1.1rem;
    line-height: 1.7;
    
}

/* List styling */
ol, ul {
    padding-left: 1.5rem;
    list-style: none;
}

ol {
    counter-reset: item;
}

ol > li {
    counter-increment: item;
    position: relative;
}

ol > li::before {
    content: counter(item) ".";
    position: absolute;
    left: -1.5rem;
    text-align: right;
}

ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ul li::before {
    content: "–"; /* em dash character */
    position: absolute;
    left: -1.5rem;
    color: #999;
    padding-right: 0.3rem;
}

/* Nested list indentation */
ol ol, ul ul, ol ul, ul ol {
    margin-bottom: 0;
    padding-left: 1.5rem;
}


.container {
    background: white;
}

/* Main content wrapper */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
}

/* Hero section */
.hero {
    width: 100%;
    height: 100svh;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 0;
    overflow: hidden;
}

/* Top and bottom gradients */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    z-index: 1;
    pointer-events: none;
}

.hero::before {
    top: 0;
    /* background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0)); */
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0.6), rgba(0,0,0,0));
}

.hero::after {
    bottom: 0;
    /* background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0)); */
    background: linear-gradient(to top, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0.6), rgba(0,0,0,0));
}

/* Hero content positioning */
.hero-content {
    position: absolute;
    top: 4rem;
    left: 4rem;
    right: 4rem;
    color: white;
    z-index: 2;
}

.company-details {
    position: absolute;
    bottom: 4rem;
    left: 4rem;
    color: white;
    z-index: 2;
}


.company-details h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
}


.detail-blocks {
  margin-top: 1.8rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: row;
}


.detail-blocks div {
    margin-right: 2.5rem;
}

.detail-blocks div b + p {
    margin-top: .4rem;
}

.future-industries {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 1.2rem;
    margin: 0rem 0 0.2rem 0;
}

.hero h1 {
    font-family: 'Raleway', sans-serif;
    font-weight: 100;
    font-size: 3.5rem;
    margin: 0 0 0.4rem 0;
    line-height: 1.2;
}

.hero h2 {
    font-family: 'Open Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 400;
    opacity: 0.9;
}

h1 {
    font-family: 'Raleway', sans-serif;
    font-weight: 100;
    font-size: 3rem;
    line-height: 1.4;
    /* margin-bottom: 1.4rem; */
}


h2 {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 1.6rem;
    margin-top: 2.8rem;
    margin-bottom: 1.4rem;
}

h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: .9rem;
    margin-top: 2.8rem;
    margin-bottom: 1.4rem;
}

h2 + h3 {
    margin-top: 1rem;
}

h4 {


}


/* Footer styling */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.8rem;
    text-align: center;
}

/* Table styles */
table {
    border-collapse: collapse;
    width: 100%;
    display: table;
    margin-bottom: 20px;
    border: 0;
}

/* Table wrapper for horizontal scrolling */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    position: relative;
}

/* For tables that need a minimum width */
.task-list table,
.project-summary table {
    min-width: 800px;
}

/* Header styles */
th {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 8px;
    border: 0;
    border-bottom: 2px solid #ddd;
    background: none;
    text-align: left;
    font-size: 0.7rem;
    vertical-align: bottom;
}

/* Cell styles */
td {
    padding: 12px 8px;
    border: none;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

/* Remove background from even rows */
tr:nth-child(even):not(.task-list-total) {
    background: none;
}

td.task-name {
    vertical-align: top;
    width: 40%;
}

.resource-type {
    border-bottom: 1px solid #ddd;
}

tr.last-resource td {
    border-bottom: 1px solid #ddd;
}

.subtotal-row td {
    border-top: none;
    border-bottom: 1px solid #ddd;
}

.subtotal-text {
    font-weight: bold;
}

.subtotal-row td.no-border {
    border: none;
}

/* Task subtotal styling */
.task-subtotal {
    background: none;
}

.task-subtotal td {
    /* padding: 16px 8px; */
    border-top: 2px solid #ddd;
    border-bottom: 1px solid #ddd;
}

/* Task list total styling */
.task-list-total {
    background: none;
    font-size: 1.1em;
}

.task-list-total td {
    /* padding: 16px 8px; */
    border-top: 2px solid #ddd;
    border-bottom: 0;
}

span.over-estimate, span.under-estimate, span.on-target {
    white-space: nowrap;
}

/* Variance styles */
.over-estimate {
    color: #d32f2f;
}

.under-estimate {
    color: #388e3c;
}

.on-target {
    color: #1976d2;
}

/* Signature Pad Styles */

.signature-pad-container,
.existing-signature {
    width: 100%;
    max-width: 600px;
    position: relative;
    margin: 20px 0;
}

.signature-pad,
#signatureDisplay {
    width: 100%;
    height: 200px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    display: block;
    margin: 0;
}

.signature-controls {
    margin-top: 10px;
    text-align: center;
}

.signature-btn {
    padding: 8px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.signature-btn-primary {
    background: #007bff;
    color: white;
}

.signature-btn-secondary {
    background: #6c757d;
    color: white;
}

.signature-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.signature-pad.signed,
#signatureDisplay.signed {
    border-color: #28a745;
    background-color: #fff;
    opacity: 1;
}

.signature-timestamp {
    margin-top: 10px;
    text-align: center;
    color: #28a745;
    font-style: italic;
}


/* Scroll Hint */
.scroll-hint {
    position: absolute;
    bottom: 3.5rem;
    right: 3.5rem;
    color: rgba(255, 255, 255, 0.8);
    z-index: 2;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.scroll-hint-hidden {
    opacity: 0;
}

.scroll-text {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.scroll-chevron {
    display: inline-block;
    transform: rotate(90deg);
    font-size: 2.1rem;
    line-height: 1;
    animation: chevronBounce 1.5s infinite;
}

@keyframes chevronBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(90deg) translateX(0);
    }
    40% {
        transform: rotate(90deg) translateX(3px);
    }
    60% {
        transform: rotate(90deg) translateX(2px);
    }
}

/* Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Media Queries */
@media (max-width: 1200px) {
    .content-wrapper {
        margin: 0;
        border-radius: 0;
    }
    
    .hero-content,
    .company-details {
        left: 2rem;
        right: 2rem;
    }
    
    .hero-content {
        top: 2rem;
    }

    .company-details {
        bottom: 3rem;
    }

    .detail-blocks {
        flex-direction: column;
    }

    .detail-blocks div {
        margin-bottom: 0.6rem;
    }

    .detail-blocks div:last-of-type {
        margin-bottom: 0;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0); /* Adjust color/opacity */
        z-index: 1;
    }
}

/* Form Container in Hero Section */

.form-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 400px;
    z-index: 2;
}

.auth-form,
.project-entry-form {
    position: relative;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    color: white;
    isolation: isolate;
}

.auth-form::before,
.project-entry-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    z-index: -1;
}

.error,
.error-message {
    background: rgba(198, 40, 40, 0.2);
    color: #ff9a9a;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-group input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.checkbox-wrapper {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #007bff;
}

.checkbox-wrapper label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

button[type="submit"] {
    width: 100%;
    padding: 0.8rem;
    background: rgba(73, 121, 168, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    isolation: isolate;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(5px);
    border-radius: 4px;
    z-index: -1;
}

button[type="submit"]:hover {
    background: rgba(0, 123, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsiveness for Forms */
@media (max-width: 768px) {
    .form-container {
        padding: 0 1rem;
    }

    .auth-form,
    .project-entry-form {
        padding: 1.5rem;
    }
}

/* Error page styles */
.error-description {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.return-button {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 123, 255, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    isolation: isolate;
}

.return-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(5px);
    border-radius: 4px;
    z-index: -1;
}

.return-button:hover {
    background: rgba(0, 123, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
}

/* Mobile Responsiveness for Forms */
@media (max-width: 768px) {
    .form-container {
        padding: 0 1rem;
    }

    .auth-form,
    .project-entry-form {
        padding: 1.5rem;
    }
}

/* Card-based layout styles */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: 
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    margin: 0;
    color: #333;
    flex: 1;
    line-height: 1.4;
}

.card-variance {
    font-size: 1rem;
    white-space: nowrap;
    margin-left: 2rem;
}

.card-variance.under-estimate::before {
    content: '$';
}

.card-variance.over-estimate::before {
    content: '+$';
}

.card-variance::after {
    content: ' left';
}

.card-variance.over-estimate::after {
    content: ' over';
}

.progress-container {
    margin: 0;
    clear: both;
}

.progress-bar {
    height: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.over-budget::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: calc(100% * var(--progress-ratio));
    background: var(--primary-color);
    border-radius: 4px 0 0 4px;
}

.progress-fill.over-budget {
    background: var(--warning-color);
}

.estimate-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: #333;
    z-index: 1;
}

.estimate-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.metadata-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    font-size: 0.8rem;
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    pointer-events: none;
    transition: 
        opacity 0.4s ease,
        max-height 0.4s ease,
        margin-top 0.4s ease,
        visibility 0s linear 0.4s;
}

.card:hover .metadata-grid {
    visibility: visible;
    opacity: 1;
    max-height: 500px; /* Set this to a value that will accommodate your content */
    margin-top: 1rem;
    pointer-events: auto;
    transition: 
        opacity 0.3s ease,
        max-height 0.4s ease,
        margin-top 0.3s ease,
        visibility 0s linear;
}

/* Resource table styles */
.resource-table {
    background: var(--section-background);
    border-radius: 4px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    transform: translateY(10px);
    transition: transform 0.4s ease;
    min-width: 0;
    overflow-x: auto;
}

.card:hover .resource-table,
.card:hover .time-entries-table {
    transform: translateY(0);
}

.resource-header {
    display: grid;
    grid-template-columns: minmax(80px, 1.5fr) minmax(60px, 1fr) minmax(80px, 1.5fr);
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: #666;
    font-size: 0.75rem;
    min-width: min-content;
}

.resource-row {
    display: grid;
    grid-template-columns: minmax(80px, 1.5fr) minmax(60px, 1fr) minmax(80px, 1.5fr);
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    min-width: min-content;
}

.resource-row:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.resource-value {
    color: #333;
}

.resource-value.hours {
    text-align: center;
}

.resource-value.cost {
    text-align: right;
}

/* Time entries table styles */
.time-entries-table {
    background: var(--section-background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transform: translateY(10px);
    transition: transform 0.4s ease;
    min-width: 0;
    overflow: hidden;
}

.time-entries-table:has(.time-row) {
    display: flex;
    flex-direction: column;
    height: 205px;
}

.time-entries-table-content {
    min-width: 0;
    overflow-x: auto;
}

.time-entries-table:has(.time-row) .time-entries-table-content {
    overflow-y: auto;
    overflow-x: auto;
    flex: 1;
}

.time-entries-table-content > div:not(.time-row) {
    padding: 0.5rem;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
}

.time-header {
    display: none;
}

.time-entries-table:has(.time-row) .time-header {
    display: grid;
    grid-template-columns: minmax(80px, 90px) minmax(60px, 70px) minmax(80px, 100px) minmax(50px, 60px) 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: #666;
    font-size: 0.75rem;
    position: sticky;
    top: 0;
    background: var(--section-background);
    z-index: 1;
}

.time-row {
    display: grid;
    grid-template-columns: minmax(80px, 90px) minmax(60px, 70px) minmax(80px, 100px) minmax(50px, 60px) 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color:  #333;
}

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

/* Remove duplicate mobile styles that were at the bottom */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }

    .resource-header,
    .resource-row {
        gap: 0.5rem;
    }

    .time-header,
    .time-row {
        gap: 0.5rem;
        padding: 0.5rem;
    }
}

/* Section header styles */
.section-header {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: .9rem;
    margin: 0;
}

.section-budget {
    font-size: 0.9rem;
    color: #666;
}

.section-budget strong {
    color: #333;
    font-weight: 600;
}

/* Variance styles */
.variance {
    font-size: 0.8rem;
}

.over-estimate {
    color: var(--warning-color);
}

.under-estimate {
    color: var(--success-color);
}

/* Media Queries for card layout */
@media (max-width: 768px) {


    h1 {
        font-size: 2.4rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.4rem; /* needs smaller for mobile */
    }

    h3, .section-title {        
        font-size: 0.8rem; /* needs smaller for mobile */
    }

    h4 {
        font-size: 0.7rem; /* needs smaller for mobile */
    }

    .detail-blocks {
        display: none;

    }

    .tagline {
        margin-top: 1.7rem;
    }
    
    .scroll-hint {
        top: 35%;
        left: 2.5rem;
        bottom: unset;
        right: unset;
    }

    .card {
        padding: 1rem;
    }

    .time-entries-table:has(.time-row) {
        display: block;
        overflow: auto;
    }

    .time-entries-table:has(.time-row) .time-entries-table-content {
        display: block;
        overflow: visible;
    }

    .time-entries-table:has(.time-row) .time-header,
    .time-row {
        min-width: 600px;
        grid-template-columns: 80px 60px 90px 60px minmax(200px, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .time-entries-table:has(.time-row) .time-header {
        position: static;
        background: none;
    }

    .resource-header,
    .resource-row {
        grid-template-columns: 1.2fr 0.8fr 1.2fr;
    }
}

/* Ensure the last row's border shows when it's not actually the last visible row */
/* .time-entries-table.has-overflow .time-row:last-child {
    border-bottom: 1px solid var(--border-color);
} */
