/* TNHI API Platform - Main Styles */

/* ========== CSS VARIABLES ========== */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

/* ========== GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== LOGIN PAGE STYLES ========== */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 50px;
    width: 100%;
    max-width: 450px;
}

.login-page .logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-page .logo h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
}

.login-page .logo p {
    color: #6b7280;
    font-size: 16px;
}

.login-page .form-group {
    margin-bottom: 25px;
}

.login-page .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.login-page .form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.login-page .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-page .btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-page .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

.login-page .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-page .error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.login-page .error-message.show {
    display: block;
}

/* ========== 404 ERROR PAGE STYLES ========== */
.error-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    padding: 2rem 0;
}

.error-container {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 2rem;
    position: relative;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: glow 2s ease-in-out infinite alternate;
}

.error-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.error-message {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.85;
    line-height: 1.6;
}

.error-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-custom {
    padding: 0.75rem 2rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
}

.btn-primary-custom {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,0.3);
}

.btn-primary-custom:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-outline-custom {
    background: transparent;
    color: white;
    border-color: rgba(255,255,255,0.6);
}

.btn-outline-custom:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateY(-2px);
    border-color: white;
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    animation: float 6s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    right: 10%;
    animation-delay: -2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: -4s;
}

.shape:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 30%;
    animation-delay: -1s;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.8;
    animation: bounce 2s ease-in-out infinite;
}

.service-status {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.service-status-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.service-status-text {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ========== 8/3 GREETING PAGE STYLES ========== */
.greeting-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.greeting-page .container {
    text-align: center;
    color: white;
    z-index: 10;
    padding: 20px;
    max-width: 900px;
    width: 100%;
}

.greeting-page h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease-out;
}

.greeting-page .date {
    font-size: 5em;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.input-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    animation: fadeIn 1.5s ease-out;
}

.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.greeting-page input[type="text"] {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    padding: 15px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 50px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    outline: none;
    transition: all 0.3s;
}

.greeting-page input[type="text"]:focus {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.greeting-page button {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.greeting-page button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.greeting-page button:active {
    transform: translateY(0);
}

.greeting-page button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Upload section styles */
.upload-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin: 10px 0;
}

.greeting-page input[type="file"] {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
}

.file-input-label:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.image-preview {
    margin: 20px auto;
    max-width: 200px;
    display: none;
}

.image-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.image-preview.show {
    display: block;
}

.clear-image {
    margin-top: 10px;
    padding: 8px 20px;
    background: rgba(255, 100, 100, 0.5);
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
}

.clear-image:hover {
    background: rgba(255, 100, 100, 0.7);
}

.result-section {
    display: none;
    animation: fadeIn 1s ease-out;
}

.result-section.show {
    display: block;
}

.person-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
    animation: zoomIn 0.8s ease-out;
}

.greeting-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    text-align: left;
}

.greeting-message {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: #fff;
}

.poem {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #f5576c;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
}

.poem-line {
    font-size: 1.2em;
    line-height: 1.8;
    margin: 5px 0;
    font-style: italic;
}

.wishes {
    margin-top: 20px;
}

.wish-item {
    font-size: 1.1em;
    margin: 12px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s;
}

.wish-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(10px);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

.back-button {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.2);
}

.flower-container {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.flower {
    position: absolute;
    font-size: 2em;
    animation: fall linear infinite;
    opacity: 0.8;
}

.heart {
    position: absolute;
    font-size: 1.5em;
    animation: heartFloat linear infinite;
    color: #ff6b9d;
}

/* ========== ADMIN DASHBOARD STYLES ========== */
.admin-page {
    background: #f1f5f9;
    overflow-x: hidden;
}

/* ========== ANIMATIONS ========== */
@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(255,255,255,0.5);
    }
    to {
        text-shadow: 0 0 30px rgba(255,255,255,0.8);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes heartFloat {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(180deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

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

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .error-code {
        font-size: 6rem;
    }
    
    .error-title {
        font-size: 2rem;
    }
    
    .error-message {
        font-size: 1rem;
    }
    
    .error-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-custom {
        width: 100%;
        max-width: 250px;
    }

    .greeting-page h1 {
        font-size: 2em;
    }
    .greeting-page .date {
        font-size: 3em;
    }
    .greeting-page input[type="text"] {
        min-width: 200px;
    }
    .person-image {
        width: 200px;
        height: 200px;
    }
    .greeting-message {
        font-size: 1.2em;
    }
    .poem-line {
        font-size: 1em;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f1f5f9;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu-item {
    margin: 0.25rem 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-menu-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: white;
}

.sidebar-menu-link i {
    width: 1.25rem;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

/* Top Bar */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 999;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-logout {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    padding: var(--topbar-height) 1.5rem 1.5rem;
}

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

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

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

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.stat-card.danger {
    border-left-color: var(--danger-color);
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.stat-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    font-size: 1.25rem;
}

.stat-icon.success { background: var(--success-color); }
.stat-icon.danger { background: var(--danger-color); }
.stat-icon.warning { background: var(--warning-color); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.stat-description {
    font-size: 0.875rem;
    color: #64748b;
}

/* Health Monitor Cards */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.health-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.health-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.health-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.health-status.healthy {
    background: #dcfce7;
    color: #166534;
}

.health-status.unhealthy {
    background: #fef2f2;
    color: #991b1b;
}

.health-status.warning {
    background: #fef3c7;
    color: #92400e;
}

.health-details {
    space-y: 0.5rem;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.health-label {
    font-size: 0.875rem;
    color: #64748b;
}

.health-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark-color);
}

/* Service Cards */
.service-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #f8fafc;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.service-header h6 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.service-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-status.healthy {
    background-color: var(--success-color);
}

.service-status.warning {
    background-color: var(--warning-color);
}

.service-status.error {
    background-color: var(--danger-color);
}

/* Service Detail Modal */
.service-status-large {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
}

.service-status-large::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: white;
}

.service-status-large.healthy {
    background-color: var(--success-color);
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.2);
}

.service-status-large.warning {
    background-color: var(--warning-color);
    box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.2);
}

.service-status-large.error {
    background-color: var(--danger-color);
    box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.2);
}

/* Metric Cards */
.metric-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    height: 100%;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.metric-unit {
    font-size: 0.6875rem;
    color: #94a3b8;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 200px;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* Activity Log */
.activity-log {
    max-height: 300px;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.activity-message {
    font-size: 0.875rem;
    color: var(--dark-color);
}

.activity-time {
    font-size: 0.75rem;
    color: #64748b;
}

.activity-status {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.activity-status.success {
    background: #dcfce7;
    color: #166534;
}

.activity-status.error {
    background: #fef2f2;
    color: #991b1b;
}

.activity-status.warning {
    background: #fef3c7;
    color: #92400e;
}

/* Modal Enhancements */
.modal-lg {
    max-width: 900px;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom: none;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-title {
    color: white;
    display: flex;
    align-items: center;
}

/* Loading Placeholder */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.25rem;
    height: 1rem;
    margin: 0.25rem 0;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tables */
.table-responsive {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table {
    margin-bottom: 0;
}

.table th {
    background: #f8fafc;
    border-top: none;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.action-btn.edit {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn.edit:hover {
    background: #bfdbfe;
}

.action-btn.delete {
    background: #fef2f2;
    color: #991b1b;
}

.action-btn.delete:hover {
    background: #fecaca;
}

.action-btn.view {
    background: #f0fdf4;
    color: #166534;
}

.action-btn.view:hover {
    background: #dcfce7;
}

/* Forms */
.form-floating > .form-control {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.form-floating > label {
    color: #6b7280;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-title {
    color: var(--dark-color);
    font-weight: 600;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.pagination-controls button {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    min-width: 150px;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 350px;
    border-left: 4px solid #6366f1;
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-content {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.toast-content i {
    color: #6366f1;
}

.toast-success .toast-content i {
    color: #10b981;
}

.toast-error .toast-content i {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .health-grid {
        grid-template-columns: 1fr;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-input,
    .filter-select {
        min-width: auto;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Utilities */
.text-muted {
    color: #6b7280 !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.bg-light-success {
    background-color: #f0fdf4 !important;
}

.bg-light-danger {
    background-color: #fef2f2 !important;
}

.bg-light-warning {
    background-color: #fefbf0 !important;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
}

.rounded-lg {
    border-radius: 0.5rem !important;
}

.border-start-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-start-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-start-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.border-start-warning {
    border-left: 4px solid var(--warning-color) !important;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* ============================================================
   PET PAGE - Nuôi Pet Online
   ============================================================ */
body.pet-page {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 30%, #a8edea 70%, #fed6e3 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

#pawContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-paw {
    position: absolute;
    top: -40px;
    animation: floatDownPaw linear infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes floatDownPaw {
    0%   { transform: translateY(-40px) rotate(0deg);   }
    100% { transform: translateY(110vh) rotate(360deg); }
}

.pet-app {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.pet-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px 16px 16px;
}

.pet-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.25);
    margin: 0 0 8px;
}

.pet-header p {
    color: rgba(255,255,255,.9);
    font-size: 1rem;
    margin: 0;
}

.pet-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    border: 1px solid rgba(255,255,255,.6);
}

.pet-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #444;
    margin: 0 0 20px;
    text-align: center;
}

.pet-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #555;
    margin: 0 0 16px;
}

/* ── Setup form ── */
.pet-setup-form .form-group {
    margin-bottom: 20px;
}

.pet-setup-form label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    font-size: .95rem;
}

.pet-setup-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
    background: #fff;
}

.pet-setup-form input[type="text"]:focus {
    border-color: #f97316;
}

.pet-setup-form input[type="text"].shake {
    animation: shake .4s ease;
    border-color: #ef4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.pet-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.pet-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-size: 1.8rem;
    transition: all .2s;
    color: #333;
}

.pet-type-btn span {
    font-size: .72rem;
    font-weight: 600;
    color: #666;
}

.pet-type-btn:hover {
    border-color: #f97316;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249,115,22,.2);
}

.pet-type-btn.selected {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 4px 12px rgba(249,115,22,.25);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f97316, #ec4899);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(249,115,22,.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249,115,22,.4);
}

/* ── Pet display ── */
.pet-display-card {
    text-align: center;
}

.pet-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.pet-name-row > div {
    text-align: left;
}

.pet-big-emoji {
    font-size: 3.5rem;
    line-height: 1;
    display: inline-block;
    animation: petBounce 2.5s ease-in-out infinite;
}

@keyframes petBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.pet-name-row h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #333;
    margin: 0 0 2px;
}

.pet-type-label {
    font-size: .8rem;
    color: #f97316;
    font-weight: 600;
    background: #fff7ed;
    border-radius: 20px;
    padding: 2px 10px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: .6;
    transition: opacity .2s;
    margin-left: auto;
    padding: 6px;
}

.btn-icon:hover { opacity: 1; }

.pet-mood {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    background: #f9fafb;
    border-radius: 12px;
    padding: 8px 16px;
    margin: 0 auto 20px;
    display: inline-block;
}

/* ── Stats ── */
.pet-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon  { font-size: 1.1rem; }

.stat-label {
    font-size: .8rem;
    font-weight: 600;
    color: #666;
    min-width: 68px;
}

.stat-bar-wrap {
    flex: 1;
    background: #f3f4f6;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    border-radius: 999px;
    transition: width .5s ease;
}

.stat-bar.high { background: linear-gradient(90deg, #4ade80, #22c55e); }
.stat-bar.mid  { background: linear-gradient(90deg, #facc15, #f97316); }
.stat-bar.low  { background: linear-gradient(90deg, #f87171, #ef4444); }

.stat-value {
    font-size: .78rem;
    font-weight: 700;
    color: #555;
    min-width: 36px;
    text-align: right;
}

/* ── Actions ── */
.pet-actions-card { }

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 14px 8px;
    border: 2px solid #f0e8ff;
    border-radius: 14px;
    background: #faf5ff;
    cursor: pointer;
    font-size: 1.6rem;
    transition: all .18s;
    color: #333;
}

.action-btn span {
    font-size: .73rem;
    font-weight: 600;
    color: #7c3aed;
}

.action-btn:hover {
    transform: translateY(-3px);
    background: #ede9fe;
    border-color: #a78bfa;
    box-shadow: 0 6px 16px rgba(124,58,237,.18);
}

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

.fact-btn {
    border-color: #fce7f3;
    background: #fdf2f8;
}

.fact-btn span { color: #be185d; }

.fact-btn:hover {
    background: #fce7f3;
    border-color: #f9a8d4;
    box-shadow: 0 6px 16px rgba(190,24,93,.15);
}

/* ── Message card ── */
.pet-message-card {
    border-left: 4px solid #f97316;
    background: rgba(255,247,237,.9);
    transition: opacity .3s;
}

.pet-message-card.pop-in {
    animation: popIn .3s ease;
}

@keyframes popIn {
    0%   { transform: scale(.95); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

.pet-message-card p {
    margin: 0;
    font-size: 1rem;
    color: #444;
    line-height: 1.6;
    font-weight: 500;
}

/* ── Achievements ── */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.achievement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: 10px;
    text-align: center;
}

.achievement span { font-size: 1.4rem; }

.achievement small {
    font-size: .62rem;
    font-weight: 600;
    line-height: 1.2;
}

.achievement.unlocked {
    background: #fef9c3;
    border: 1px solid #fde047;
}

.achievement.unlocked small { color: #854d0e; }

.achievement.locked {
    background: #f3f4f6;
    filter: grayscale(1);
    opacity: .5;
}

.achievement.locked small { color: #9ca3af; }

/* ── Utility ── */
.hidden { display: none !important; }
}