/* CSS Custom Properties */
:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --accent-color: #FF8C00;
    --warning-color: #FFA500;
    --success-color: #FFD700;
    --white: #FFFFFF;
    --gray-100: #F5F5F5;
    --gray-200: #E0E0E0;
    --gray-300: #CCCCCC;
    --gray-400: #999999;
    --gray-500: #666666;
    --gray-600: #333333;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-600);
    background-color: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}
.black-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 30px;
background-color: #000000;
z-index: 1001;
}
.header__container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header__logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.header__content {
    text-align: left;
}

.header__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.header__subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

/* Navigation */
.nav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav__list {
    display: flex;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav__item {
    flex: 1;
    min-width: 120px;
}

.nav__button {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    color: var(--gray-500);
    border-bottom: 3px solid transparent;
}

.nav__button:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.nav__button--active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    margin-top: 140px;
}

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section--active {
    display: block;
}

.section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section__title {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 700;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn--secondary {
    background: var(--gray-200);
    color: var(--gray-600);
}

.btn--secondary:hover {
    background: var(--gray-300);
}

.btn--success {
    background: var(--success-color);
    color: var(--gray-600);
}

.btn--success:hover {
    background: var(--warning-color);
}

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

/* Calendar */
.calendar {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.calendar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar__nav {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.calendar__nav:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.calendar__title {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.calendar__day {
    background: var(--white);
    padding: 1rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.calendar__day:hover {
    background: var(--gray-100);
}

.calendar__day--other-month {
    color: var(--gray-400);
    background: var(--gray-100);
}

.calendar__day--today {
    background: var(--accent-color);
    color: var(--white);
    font-weight: 600;
}

.calendar__day--has-appointment {
    background: var(--success-color);
    color: var(--gray-600);
}

.calendar__day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.calendar__appointments {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Appointments Today */
.appointments-today {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.appointments-today__title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.appointments-today__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.appointment-card {
    background: var(--gray-100);
    border-radius: var(--border-radius);
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.appointment-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.appointment-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.appointment-card__title {
    font-weight: 600;
    color: var(--primary-color);
}

.appointment-card__time {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.appointment-card__details {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Reminders */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.reminder-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--warning-color);
}

.reminder-card--urgent {
    border-left-color: var(--accent-color);
    background: linear-gradient(90deg, rgba(255, 140, 0, 0.1), var(--white));
}

.reminder-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.reminder-card__title {
    color: var(--primary-color);
    font-weight: 600;
}

.reminder-card__time {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.reminder-config {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: none;
}

.reminder-config--active {
    display: block;
}

.reminder-config__title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Checklist */
.checklist-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.checklist-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 100px;
}

.checklist {
    margin-bottom: 2rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    background: var(--gray-100);
}

.checklist-item:hover {
    background: var(--gray-200);
}

.checklist-item--completed {
    background: var(--success-color);
    opacity: 0.8;
}

.checklist-item__checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checklist-item__text {
    flex: 1;
    font-size: 1rem;
}

.checklist-item--completed .checklist-item__text {
    text-decoration: line-through;
    color: var(--gray-500);
}

.checklist-item__delete {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition);
}

.checklist-item__delete:hover {
    background: var(--gray-300);
    color: var(--gray-600);
}

.checklist-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* History */
.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card__number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card__label {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.history-item:hover {
    box-shadow: var(--shadow-md);
}

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

.history-item__title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.history-item__status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.history-item__status--completed {
    background: var(--success-color);
    color: var(--gray-600);
}

.history-item__status--cancelled {
    background: var(--gray-300);
    color: var(--gray-600);
}

.history-item__status--upcoming {
    background: var(--accent-color);
    color: var(--white);
}

.history-item__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-600);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

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

.form-checkbox {
    margin-right: 0.5rem;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
}

.modal--active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__content {
    background: var(--white);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal__title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0.25rem;
    transition: var(--transition);
}

.modal__close:hover {
    color: var(--gray-600);
}

.modal__form {
    padding: 1.5rem;
}

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

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    animation: toastSlideIn 0.3s ease-out;
    max-width: 350px;
}

.toast--success {
    border-left-color: var(--success-color);
}

.toast--error {
    border-left-color: var(--accent-color);
}

.toast--warning {
    border-left-color: var(--warning-color);
}

.toast__title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--gray-600);
}

.toast__message {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    margin-bottom: 200px;
    
}

.footer__text {
    opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .header__logo {
        width: 42px;
        height: 42px;
    }
    
    .header__title {
        font-size: 1.2rem;
    }
    
    .header__subtitle {
        font-size: 0.75rem;
    }
    
    .main {
        margin-top: 70px;
    }
    
    .section__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section__title {
        font-size: 1.5rem;
    }
    
    .calendar__grid {
        font-size: 0.9rem;
    }
    
    .calendar__day {
        min-height: 60px;
        padding: 0.5rem;
    }
    
    .modal__content {
        margin: 1rem;
    }
    
    .modal__actions {
        flex-direction: column;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .history-item__details {
        grid-template-columns: 1fr;
    }
    
    .checklist-actions {
        flex-direction: column;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .nav__button {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .calendar,
    .appointments-today,
    .checklist-container {
        padding: 1rem;
    }
    
    .appointment-card,
    .reminder-card,
    .history-item {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card__number {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .nav,
    .modal,
    .toast-container,
    .loading-overlay {
        display: none !important;
    }
    
    .section {
        display: block !important;
    }
    
    .header {
        background: none !important;
        color: var(--gray-600) !important;
    }
    
    .btn {
        display: none !important;
    }
    
    .calendar__nav {
        display: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #333333;
        --accent-color: #FF0000;
        --gray-100: #FFFFFF;
        --gray-600: #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Bottom Navigation - Mobile */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
    margin-bottom: 80px;
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
    gap: 0.25rem;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
    transition: transform 0.3s ease;
}

.bottom-nav__item--active::before {
    transform: translateX(-50%) scaleX(1);
}

.bottom-nav__item:active {
    transform: scale(0.95);
}

.bottom-nav__item--active {
    color: var(--primary-color);
}

.bottom-nav__icon {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    transition: var(--transition);
}

.bottom-nav__item--active .bottom-nav__icon {
    stroke-width: 2.5;
    transform: translateY(-2px);
}

.bottom-nav__label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: var(--transition);
    white-space: nowrap;
}

.bottom-nav__item--active .bottom-nav__label {
    font-weight: 600;
    color: var(--primary-color);
}

/* Show bottom nav on mobile */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    
    /* Hide top navigation on mobile */
    .nav {
        display: none;
    }
    
    /* Adjust main content to account for bottom nav */
    .main {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
    }
    
    /* Adjust footer margin */
    .footer {
        margin-bottom: calc(130px + env(safe-area-inset-bottom, 0));
    }
    
    /* Adjust toast container for bottom nav */
    .toast-container {
        bottom: calc(80px + env(safe-area-inset-bottom, 0));
        top: auto;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .bottom-nav__label {
        font-size: 0.6rem;
    }
    
    .bottom-nav__icon {
        width: 20px;
        height: 20px;
    }
}
