/* Time Tracker Styles */

.time-tracker-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Authentication Screen */
.auth-container {
    max-width: 450px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #333;
}

.auth-container .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.switch-auth {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.switch-auth a {
    color: #007bff;
    text-decoration: none;
}

.switch-auth a:hover {
    text-decoration: underline;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #0056b3;
}

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

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.app-header h1 {
    margin: 0;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: #666;
}

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

.section-header h2 {
    margin: 0;
    color: #333;
}

/* Projects List */
.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-info h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.project-rate {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.project-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.stat-amount {
    color: #28a745;
}

.project-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Summary Box */
.summary-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

/* Entries List */
.entries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.entry-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.entry-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.entry-date {
    font-weight: 600;
    color: #333;
}

.entry-time {
    color: #007bff;
    font-weight: 500;
}

.entry-amount {
    color: #28a745;
    font-weight: 600;
    margin-left: auto;
}

.entry-notes {
    color: #666;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.entry-actions {
    display: flex;
    gap: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-size: 1.125rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-wide {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f8f9fa;
}

.modal-content form {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Error Message */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Logo Preview */
.logo-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.logo-preview:not(:empty) {
    display: block;
}

.logo-preview img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Invoice Styles */
.modal-invoice {
    max-width: 900px;
}

.modal-header .invoice-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.invoice-content {
    padding: 2rem;
    background: white;
}

.invoice-page {
    max-width: 800px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, sans-serif;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #333;
}

.invoice-logo img {
    max-width: 150px;
    max-height: 80px;
    object-fit: contain;
}

.invoice-from h2 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.invoice-from p {
    margin: 0.25rem 0;
    color: #666;
}

.invoice-title {
    text-align: center;
    margin-bottom: 2rem;
}

.invoice-title h1 {
    font-size: 2.5rem;
    margin: 0;
    color: #333;
}

.invoice-date {
    color: #666;
    margin-top: 0.5rem;
}

.invoice-to {
    margin-bottom: 2rem;
}

.invoice-to h3 {
    margin: 0 0 1rem 0;
    color: #333;
}

.invoice-to p {
    margin: 0.25rem 0;
    color: #666;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

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

.invoice-table th,
.invoice-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.invoice-table th {
    font-weight: 600;
    color: #333;
}

.invoice-table td {
    color: #666;
}

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

.invoice-summary {
    max-width: 360px;
    margin-left: auto;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 2px solid #333;
    padding-top: 1rem;
}

.invoice-summary .summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1.05rem;
}

.invoice-summary .summary-label {
    color: #333;
}

.invoice-summary .summary-value {
    color: #333;
    font-weight: 600;
}

.invoice-summary .summary-total .summary-value {
    font-size: 1.15rem;
}

.invoice-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .time-tracker-container {
        padding: 1rem 0.5rem;
    }

    .auth-container {
        margin: 2rem auto;
        padding: 1.5rem;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .projects-list {
        grid-template-columns: 1fr;
    }

    .summary-box {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .entry-amount {
        margin-left: 0;
    }

    .project-actions {
        flex-direction: column;
    }

    .project-actions .btn {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }
}

/* Print Styles */
@media print {
    .app-header,
    .section-header,
    .project-actions,
    .entry-actions,
    .btn,
    .modal {
        display: none !important;
    }

    .entry-card,
    .project-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
