/* HabitWins Tabs & Forms CSS - Modal tabs, forms, and interactive elements */

/* Tracking Modal (base modal styles centralized in modals.css) */

.modal-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 0 50px;
}

.modal-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

/*Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 10px;
    margin: 0;
    border: none;
}

/* .modal-tab styles moved to contract-details.css - SINGLE OWNERSHIP */

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

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

/* Settings & Rewards Tabs */
.habit-settings, .habit-rewards, .habit-notifications {
    padding: 10px 0;
}

.habit-settings h4, .habit-rewards h4, .habit-notifications h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1rem;
}

/* Notification Tab Styles */
.notification-status {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.notification-schedule {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.schedule-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
}

.current-schedule {
    margin-bottom: 15px;
}

.schedule-day {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.schedule-day:last-child {
    border-bottom: none;
}

.schedule-day-name {
    font-weight: 600;
    width: 100px;
    color: #495057;
}

.schedule-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.schedule-time {
    background: var(--primary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.schedule-actions {
    text-align: center;
    margin-top: 15px;
}

.edit-schedule-modal {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.edit-schedule-content {
    margin: 15px 0;
}

.schedule-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.btn-edit {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.btn-cancel {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-cancel:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Edit Notification Form Styles */
.edit-notification-info {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #2196f3;
}

.edit-notification-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.form-section {
    margin-bottom: 15px;
}

.form-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.edit-day-group {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.edit-day-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.edit-day-checkbox {
    width: 18px;
    height: 18px;
}

.edit-day-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.edit-times-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.edit-time-input {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 80px;
}

.edit-time-bell {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.edit-time-bell:hover {
    background: #f8f9fa;
    color: #495057;
}

.edit-time-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
}

.edit-time-remove:hover {
    background: #f8d7da;
}

.edit-add-time {
    background: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.edit-add-time:hover {
    background: #218838;
    transform: translateY(-1px);
}

.day-row {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
}

.day-row-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.day-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.day-label {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.times-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.time-input {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 80px;
}

.time-bell {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.time-bell:hover {
    background: #e9ecef;
    color: #495057;
}

.add-time-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.add-time-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.remove-time {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    margin-left: 4px;
}

.remove-time:hover {
    background: #f8d7da;
}

/* Mobile modal tabs adjustments */
@media (max-width: 768px) {
    /* .modal-content inherited from modals.css - SINGLE SOURCE OF TRUTH */

    /* .modal-tabs and .modal-tab styles moved to contract-details.css - SINGLE OWNERSHIP */

    /* Full screen modal for contract details */
    /* WARNING: These styles are OVERRIDDEN by contract-details.css (loads last in base.html line 77) */
    /* ACTUAL full screen styles are in contract-details.css @media (max-width: 768px) */
    /* DO NOT EDIT HERE - edit contract-details.css instead for .calendar-modal-content mobile styles */
    #calendarModal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
        background: transparent;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }

    #calendarModal.active {
        background: transparent;
    }

    .calendar-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        padding: 15px;
        border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #ffffff;
    }

    .edit-times-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .times-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .time-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* .modal-tabs and .modal-tab styles moved to contract-details.css - SINGLE OWNERSHIP */

    .close-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .day-row-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .form-section label {
        font-size: 0.9rem;
    }

    .schedule-edit-actions {
        flex-direction: column;
        gap: 8px;
    }
}