/* ============================================
   DAILY ROUTINE SECTION STYLES
   Color Scheme: #3a3182 (Purple) & #eaa521 (Gold) & White
   ============================================ */

/* Section Container */
.routine-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.routine-section::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(58, 49, 130, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.routine-section::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(234, 165, 33, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

/* Header Section */
.routine-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.routine-subtitle {
    color: #eaa521;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.routine-title {
    color: #3a3182;
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.routine-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #3a3182, #eaa521);
    border-radius: 2px;
}

.routine-description {
    color: #666;
    font-size: 17px;
    line-height: 1.8;
    max-width: 800px;
    margin: 30px auto 0;
}

/* Table Container */
.routine-table-container {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(58, 49, 130, 0.12);
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.routine-table-container:hover {
    box-shadow: 0 15px 50px rgba(58, 49, 130, 0.18);
    transform: translateY(-5px);
}

/* Table Header */
.table-header {
    background: linear-gradient(135deg, #3a3182 0%, #4a4192 100%);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.table-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(234, 165, 33, 0.1) 0%, transparent 70%);
    animation: rotate-slow 30s linear infinite;
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.table-header svg {
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.table-header h2 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}

.holiday-header {
    background: linear-gradient(135deg, #eaa521 0%, #f5b841 100%);
}

.table-header .subtitle {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

/* Table Responsive Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table Styles */
.routine-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.routine-table thead tr {
    background: linear-gradient(135deg, #3a3182 0%, #4a4192 100%);
}

.routine-table thead th {
    color: #ffffff;
    font-weight: 700;
    padding: 18px 20px;
    text-align: left;
    font-size: 16px;
    border-bottom: 3px solid #eaa521;
}

.time-column {
    width: 180px;
    min-width: 150px;
}

.residential-column,
.dayboarding-column {
    width: auto;
}

.activity-column {
    width: auto;
}

/* Table Body */
.routine-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.routine-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(234, 165, 33, 0.05) 0%, rgba(58, 49, 130, 0.05) 100%);
    transform: scale(1.01);
}

.routine-table tbody tr:last-child {
    border-bottom: none;
}

.routine-table tbody td {
    padding: 16px 20px;
    color: #555;
    line-height: 1.7;
    vertical-align: top;
}

/* Time Cell */
.time-cell {
    font-weight: 700;
    color: #3a3182;
    background: linear-gradient(90deg, rgba(58, 49, 130, 0.05) 0%, transparent 100%);
    white-space: nowrap;
    position: relative;
}

.time-cell::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3a3182, #eaa521);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.routine-table tbody tr:hover .time-cell::before {
    opacity: 1;
}

/* Dash Cell */
.dash-cell {
    text-align: center;
    color: #ccc;
    font-size: 20px;
    font-weight: 300;
}

/* Highlight Rows (Same for both) */
.highlight-row {
    background: rgba(234, 165, 33, 0.08);
}

.highlight-row:hover {
    background: linear-gradient(90deg, rgba(234, 165, 33, 0.12) 0%, rgba(58, 49, 130, 0.08) 100%);
}

.highlight-row td {
    font-weight: 500;
}

/* Activity Rows */
.activity-row {
    background: rgba(58, 49, 130, 0.04);
}

.activity-row:hover {
    background: rgba(58, 49, 130, 0.08);
}

/* Final Row */
.final-row {
    background: linear-gradient(135deg, rgba(58, 49, 130, 0.1) 0%, rgba(234, 165, 33, 0.1) 100%);
    font-weight: 700;
}

.final-row td {
    color: #3a3182;
    padding: 20px;
}

.final-row:hover {
    background: linear-gradient(135deg, rgba(58, 49, 130, 0.15) 0%, rgba(234, 165, 33, 0.15) 100%);
}

/* Holiday Table Specific */
.holiday-table thead tr {
    background: linear-gradient(135deg, #eaa521 0%, #f5b841 100%);
}

.holiday-table thead th {
    border-bottom: 3px solid #3a3182;
}

/* Special Note */
.special-note {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
    border-left: 4px solid #eaa521;
    padding: 20px 25px;
    margin: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(234, 165, 33, 0.15);
}

.special-note svg {
    flex-shrink: 0;
}

.special-note p {
    color: #555;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
    font-weight: 500;
}

/* Responsive Design */

/* Large Tablets */
@media (max-width: 1024px) {
    .routine-title {
        font-size: 42px;
    }

    .table-header h2 {
        font-size: 26px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .routine-section {
        padding: 60px 0;
    }

    .routine-title {
        font-size: 36px;
    }

    .routine-description {
        font-size: 16px;
        padding: 0 15px;
    }

    .table-header {
        padding: 25px 20px;
    }

    .table-header h2 {
        font-size: 24px;
    }

    .routine-table {
        font-size: 14px;
    }

    .routine-table thead th {
        padding: 15px 12px;
        font-size: 15px;
    }

    .routine-table tbody td {
        padding: 14px 12px;
    }

    .time-column {
        width: 140px;
        min-width: 120px;
    }

    .special-note {
        flex-direction: column;
        text-align: center;
        padding: 18px 20px;
        margin: 20px;
    }
}

/* Mobile Devices */
@media (max-width: 576px) {
    .routine-section {
        padding: 50px 0;
    }

    .routine-subtitle {
        font-size: 14px;
    }

    .routine-title {
        font-size: 32px;
    }

    .routine-description {
        font-size: 15px;
    }

    .routine-table-container {
        border-radius: 15px;
        margin-bottom: 30px;
    }

    .table-header {
        padding: 20px 15px;
    }

    .table-header h2 {
        font-size: 22px;
    }

    .table-header svg {
        width: 35px;
        height: 35px;
    }

    .routine-table {
        font-size: 13px;
    }

    .routine-table thead th {
        padding: 12px 10px;
        font-size: 14px;
    }

    .routine-table tbody td {
        padding: 12px 10px;
    }

    .time-column {
        width: 110px;
        min-width: 100px;
        font-size: 12px;
    }

    .time-cell {
        font-size: 12px;
    }

    .special-note {
        padding: 15px;
        margin: 15px;
    }

    .special-note svg {
        width: 20px;
        height: 20px;
    }

    .special-note p {
        font-size: 14px;
    }
}

/* Extra Small Devices */
@media (max-width: 400px) {
    .routine-title {
        font-size: 28px;
    }

    .table-header h2 {
        font-size: 20px;
    }

    .routine-table {
        font-size: 12px;
    }

    .routine-table thead th {
        padding: 10px 8px;
        font-size: 13px;
    }

    .routine-table tbody td {
        padding: 10px 8px;
    }

    .time-column {
        width: 95px;
        min-width: 90px;
    }
}

/* Scrollbar Styling for Table */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #3a3182, #eaa521);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #2a2172, #da9511);
}

/* Print Styles */
@media print {
    .routine-section {
        padding: 40px 0;
        background: white;
    }

    .routine-table-container {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        margin-bottom: 30px;
    }

    .table-header {
        background: #3a3182 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .routine-table thead tr {
        background: #3a3182 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .routine-table tbody tr:hover {
        background: none;
        transform: none;
    }

    .special-note {
        border: 1px solid #eaa521;
        box-shadow: none;
    }
}

/* Animation for Table Rows */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.routine-table tbody tr {
    animation: slideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.routine-table tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.routine-table tbody tr:nth-child(2) {
    animation-delay: 0.1s;
}

.routine-table tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.routine-table tbody tr:nth-child(4) {
    animation-delay: 0.2s;
}

.routine-table tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .routine-table tbody tr {
        animation: none;
    }

    .table-header::before {
        animation: none;
    }
}