/* static/style.css */

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* Giữ màu nền nhạt */
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #1F4A4D; /* Màu xanh teal đậm từ logo */
    color: #fff;
    padding: 1rem 0;
    border-bottom: 5px solid #6DD5ED; /* Màu xanh da trời nhạt làm đường viền nhấn */
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.2em;
}

.main-nav {
    margin-top: 10px;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.nav-item:hover, .nav-item.active {
    background-color: #2E656B; /* Sắc xanh teal đậm hơn khi hover/active */
}

main {
    padding: 20px 0;
}

footer {
    text-align: center;
    padding: 1rem 0;
    background: #1F4A4D; /* Màu xanh teal đậm cho footer */
    color: #fff;
    margin-top: 20px;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 20px;
}
.alert {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* Form Styling */
form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

form input[type="text"],
form input[type="email"],
form input[type="date"],
form input[type="number"],
form select,
form textarea {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

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

/* Buttons */
.btn, .btn-primary, .btn-secondary, .btn-edit, .btn-delete, .btn-view, .btn-small {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: #1F4A4D; /* Màu xanh teal đậm cho nút chính */
    color: #fff;
}

.btn-primary:hover {
    background-color: #2E656B; /* Sắc xanh teal đậm hơn khi hover */
}

.btn-secondary {
    background-color: #6c757d; /* Giữ màu xám cho nút phụ */
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-edit {
    background-color: #6DD5ED; /* Màu xanh da trời nhạt làm nút chỉnh sửa */
    color: #1F4A4D; /* Chữ màu đậm trên nền sáng */
}
.btn-edit:hover {
    background-color: #5BC0DE; /* Sắc xanh da trời nhạt hơn khi hover */
}

.btn-delete {
    background-color: #dc3545; /* Giữ màu đỏ cho nút xóa */
    color: #fff;
}
.btn-delete:hover {
    background-color: #c82333;
}

.btn-view {
    background-color: #17a2b8; /* Giữ màu xanh nước biển cho nút xem */
    color: #fff;
}
.btn-view:hover {
    background-color: #138496;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8em;
    margin-right: 5px;
}

/* Table Styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow-x: auto;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background-color: #1F4A4D; /* Màu xanh teal đậm cho header table */
    color: #fff;
    text-transform: uppercase;
    font-weight: bold;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

.data-table .actions {
    white-space: nowrap;
}

.data-table .actions form {
    display: inline-block;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.data-table .actions button {
    margin-right: 5px;
    margin-bottom: 0;
}

/* Dashboard Cards */
.dashboard-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    margin-bottom: 30px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    flex: 1 1 calc(33.333% - 20px);
    max-width: calc(33.333% - 20px);
    min-width: 250px;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .card-link {
        flex: 1 1 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .card-link {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #1F4A4D; /* Màu xanh teal đậm cho tiêu đề card */
}

.card p {
    font-size: 2.5em;
    font-weight: bold;
    color: #6DD5ED; /* Màu xanh da trời nhạt cho số liệu */
    margin: 0;
}

/* Recent Activity Section */
.recent-activity {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recent-activity h3 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.customer-item {
    border-bottom: 1px dashed #eee;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-item:last-child {
    border-bottom: none;
}

.customer-item p {
    margin: 0;
    font-size: 1em;
}

.customer-item .btn-small {
    margin-bottom: 0;
}

/* Treatment Detail Styling */
.customer-info, .treatment-list, .add-treatment-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.customer-info p {
    margin-bottom: 10px;
}

.customer-info .actions {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.treatment-item {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background-color: #fafafa;
}

.treatment-item h4 {
    margin-top: 0;
    color: #1F4A4D; /* Màu xanh teal đậm */
}

.treatment-image img {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 10px;
    max-height: 300px;
    object-fit: cover;
    width: 100%;
}

.add-treatment-form h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.product-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.product-entry select {
    flex: 2;
}

.product-entry input[type="number"] {
    flex: 1;
    max-width: 100px;
}

.product-entry .remove-product-btn {
    background-color: #ff5722; /* Giữ màu cam để xóa */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}
.product-entry .remove-product-btn:hover {
    background-color: #e64a19;
}

/* Coming Soon Page */
.coming-soon {
    text-align: center;
    padding: 50px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.coming-soon h2 {
    color: #1F4A4D; /* Màu xanh teal đậm */
    font-size: 2.5em;
    margin-bottom: 20px;
}

.coming-soon p {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 30px;
}


/* --- Responsive Adjustments --- */

/* For screens smaller than 768px (most tablets in portrait and phones) */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .main-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 5px;
    }

    .nav-item {
        margin: 5px;
        flex: 1 1 auto;
        max-width: 150px;
        text-align: center;
        font-size: 0.9em;
        padding: 0.4rem 0.8rem;
    }

    /* Table adjustments */
    .data-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Force table cells to be block for better readability on small screens */
    .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr {
        display: block;
    }

    .data-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .data-table tr {
        border: 1px solid #ddd;
        margin-bottom: 10px;
        border-radius: 8px;
        overflow: hidden;
    }

    .data-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
        white-space: normal;
    }

    .data-table td:last-child {
        border-bottom: none;
    }

    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #555;
    }

    /* Specific adjustments for input fields in forms */
    form input[type="text"],
    form input[type="email"],
    form input[type="date"],
    form input[type="number"],
    form select,
    form textarea {
        width: calc(100% - 20px);
        padding: 8px;
    }

    .btn, .btn-primary, .btn-secondary, .btn-edit, .btn-delete, .btn-view, .btn-small {
        display: block;
        width: calc(100% - 20px);
        margin: 5px auto;
        font-size: 0.95em;
        padding: 10px;
    }

    .btn-small {
        width: auto;
        display: inline-block;
    }
    
    .customer-info .actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 10px;
    }

    .customer-info .actions .btn-edit,
    .customer-info .actions .btn-delete,
    .customer-info .actions .btn-secondary {
        flex: 1 1 auto;
        max-width: calc(50% - 10px);
        margin: 0;
    }
    
    .customer-info .actions form {
        flex: 1 1 auto;
        max-width: calc(50% - 10px);
    }
    .customer-info .actions form button {
        width: 100%;
        margin: 0;
    }

    .product-entry {
        flex-direction: column;
        align-items: stretch;
    }

    .product-entry select,
    .product-entry input[type="number"] {
        width: 100%;
        max-width: unset;
    }
    
    .product-entry .remove-product-btn {
        width: 100%;
        margin-top: 5px;
    }

}

/* For very small screens (e.g., iPhone 5/SE) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }
    .nav-item {
        font-size: 0.8em;
        padding: 0.3rem 0.6rem;
    }
    .data-table td {
        padding-left: 45%;
    }
}
