/* ========== RESET & BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== LOGIN OVERLAY ========== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #333333 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-container {
    background: #ffffff;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 3px solid #000000;
    animation: slideUp 0.5s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #666666;
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-group i {
    position: absolute;
    left: 1rem;
    color: #666666;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.login-input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #d1d5db;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.login-input-group input:focus {
    outline: none;
    border-color: #000000;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.login-input-group input:focus + i,
.login-input-group:focus-within i {
    color: #000000;
}

.login-input-group input::placeholder {
    color: #999999;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: #000000;
    color: #ffffff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.login-btn:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.login-footer {
    text-align: center;
    color: #999999;
    font-size: 0.85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

/* Main Content Hidden State */
.main-content.hidden {
    display: none;
}

/* Logout Button */
.btn-logout {
    background: transparent;
    color: #666666;
    border: 2px solid #666666;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 576px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .login-container {
        padding: 2rem 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}

:root {
    /* Professional Black & White Color Palette */
    --primary-color: #000000;
    --primary-hover: #333333;
    --secondary-color: #666666;
    --accent-color: #1a1a1a;
    --success-color: #2d5016;
    --danger-color: #8b0000;
    --warning-color: #8b6508;
    --dark-bg: #000000;
    --light-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #d1d5db;
    --text-primary: #000000;
    --text-secondary: #666666;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.15);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.2);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    background: #f5f5f5;
    min-height: 100vh;
    padding: var(--spacing-md);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--light-bg);
    border-radius: 0;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

/* ========== HEADER ========== */
.header {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    border-bottom: 4px solid var(--accent-color);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    font-size: 2.5rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.date-section input[type="date"] {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid white;
    border-radius: 0;
    font-size: 1rem;
    background: white;
    color: var(--text-primary);
    font-weight: 600;
}

/* ========== NAVIGATION TABS ========== */
.nav-tabs {
    display: flex;
    background: white;
    border-bottom: 3px solid var(--primary-color);
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.tab-button {
    flex: 1;
    min-width: 150px;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-bottom: 4px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-button:hover {
    background: #f9f9f9;
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #f9f9f9;
}

.tab-button i {
    font-size: 1.1rem;
}

/* ========== TAB CONTENT ========== */
.tab-content-container {
    padding: var(--spacing-xl);
    min-height: 60vh;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* ========== CARDS ========== */
.card {
    background: var(--card-bg);
    border-radius: 0;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header h2 i {
    color: var(--primary-color);
    margin-right: 8px;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-weight: 600;
}

/* ========== BUTTONS ========== */
.btn-add,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-pdf {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 2px solid var(--primary-color);
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add,
.btn-primary,
.btn-pdf {
    background: var(--primary-color);
    color: white;
}

.btn-add:hover,
.btn-primary:hover,
.btn-pdf:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-remove {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: white;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
    border-radius: 0;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    font-weight: 700;
}

.btn-remove:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.05);
}

/* ========== FORM ELEMENTS ========== */
.entries-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.entry-item {
    background: #fafafa;
    padding: var(--spacing-lg);
    border-radius: 0;
    border: 2px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    position: relative;
    transition: all 0.3s ease;
}

.entry-item:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--accent-color);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.entry-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: 0;
    font-size: 0.95rem;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--danger-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ========== CONDITIONAL FIELDS ========== */
.conditional-field {
    display: none;
    animation: slideDown 0.3s ease;
}

.conditional-field.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* ========== SUMMARY CARD ========== */
.summary-card {
    background: var(--primary-color);
    color: white;
    border: 3px solid var(--accent-color);
}

.summary-card h2 {
    color: white;
}

.summary-card h2 i {
    color: white;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.summary-item {
    background: rgba(255, 255, 255, 0.15);
    padding: var(--spacing-lg);
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.summary-label {
    font-weight: 600;
    font-size: 1rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ========== TASKS SECTION ========== */
.tasks-subsection {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--border-color);
}

.tasks-subsection:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.task-list {
    margin-bottom: var(--spacing-md);
}

.task-item {
    background: var(--light-bg);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.task-content {
    flex: 1;
}

.task-input {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

/* ========== ARCHIVE MESSAGES ========== */
.archive-input-group {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.archive-input-group textarea {
    flex: 1;
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.archive-item {
    background: var(--light-bg);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: var(--spacing-md);
}

.archive-content {
    flex: 1;
}

.archive-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* ========== RICH TEXT EDITOR ========== */
.rich-text-toolbar {
    background: var(--light-bg);
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.toolbar-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

.rich-text-content {
    min-height: 150px;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: white;
    outline: none;
    line-height: 1.8;
}

.rich-text-content:focus {
    border-color: var(--primary-color);
}

/* ========== ACTION BUTTONS ========== */
.action-buttons {
    padding: var(--spacing-xl);
    background: white;
    border-top: 3px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.pdf-buttons-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.pdf-buttons-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.pdf-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.google-sheets-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: #f0f9ff;
    border: 2px solid var(--primary-color);
    border-radius: 0;
}

.google-sheets-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.google-sheets-group .hint-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.btn-google {
    padding: var(--spacing-md) var(--spacing-xl);
    background: #0f9d58;
    color: white;
    border: 2px solid #0f9d58;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-google:hover {
    background: #0b8043;
    border-color: #0b8043;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-buttons .btn-secondary {
    align-self: flex-start;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--dark-bg);
    color: white;
    text-align: center;
    padding: var(--spacing-lg);
    font-size: 0.9rem;
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin-loader 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 0;
    }
    
    .header {
        padding: var(--spacing-lg);
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .nav-tabs {
        position: static;
    }
    
    .tab-button {
        min-width: 120px;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.85rem;
    }
    
    .tab-content-container {
        padding: var(--spacing-md);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        padding: var(--spacing-md);
    }
    
    .action-buttons .btn-primary,
    .action-buttons .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .archive-input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo-section {
        justify-content: center;
    }
    
    .date-section input {
        width: 100%;
    }
    
    .tab-button {
        min-width: 100px;
        padding: var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    .tab-button i {
        display: none;
    }
    
    .entry-item {
        padding: var(--spacing-md);
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .nav-tabs,
    .action-buttons,
    .footer,
    .btn-add,
    .btn-remove {
        display: none !important;
    }
    
    .container {
        box-shadow: none;
    }
    
    .card {
        page-break-inside: avoid;
    }
}
