@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1dd4d7;
    --primary-hover: #15b8bb;
    --primary-light: rgba(29, 212, 215, 0.08);
    --primary-light-hover: rgba(29, 212, 215, 0.15);
    --text: #222222;
    --text-secondary: #64748b;
    --bg: #ffffff;
    --bg-light: #f8fafc;
    --border: #f1f5f9;
    --border-hover: #cbd5e1;
    --sidebar-width: 270px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.03), 0 2px 4px -1px rgba(0,0,0,0.02);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.04), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Container */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar / Vertical Menu */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-header {
    padding: 24px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    background: var(--primary-light);
    color: var(--primary);
    padding: 10px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.sidebar-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
}

.sidebar-user {
    padding: 24px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: var(--bg);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(29, 212, 215, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
}

.sidebar-menu li a i {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.sidebar-menu li a:hover {
    color: var(--text);
    background-color: var(--border);
}

.sidebar-menu li a.active {
    color: var(--primary);
    background-color: var(--primary-light);
    font-weight: 600;
}

.sidebar-menu li a.active i {
    color: var(--primary);
}

.sidebar-menu li a.disabled-link {
    opacity: 0.6;
    cursor: not-allowed;
}

.menu-logout {
    margin-top: auto;
}

.menu-logout a:hover {
    color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* Menu Toggle Button (Mobile) */
.menu-toggle {
    display: none;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.menu-toggle i {
    width: 20px;
    height: 20px;
    color: var(--text);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    max-width: 1400px;
    width: calc(100% - var(--sidebar-width));
}

/* Header Top */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.page-title-area h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.avatar-small {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Cards & Containers */
.card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Dashboard Welcome Banner */
.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, #15b8bb 100%);
    color: var(--bg);
    border: none;
    position: relative;
}

.welcome-card:hover {
    transform: none;
    box-shadow: 0 12px 30px rgba(29, 212, 215, 0.2);
}

.welcome-card h3 {
    font-size: 24px;
    font-weight: 700;
}

.welcome-card p {
    opacity: 0.9;
    max-width: 600px;
}

.welcome-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    pointer-events: none;
}

/* Dashboard Quick Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-top: 8px;
    color: var(--text);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

/* Forms styling */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    background: var(--bg);
}

.form-control::placeholder {
    color: #a0aec0;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(29, 212, 215, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    padding-right: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
    box-shadow: 0 4px 12px rgba(29, 212, 215, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(29, 212, 215, 0.3);
}

.btn-block {
    width: 100%;
}

/* Auth Screens Layout */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(29, 212, 215, 0.05) 0%, rgba(255, 255, 255, 0) 90%), var(--bg-light);
    padding: 24px;
}

.login-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    position: relative;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.login-logo i {
    width: 28px;
    height: 28px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 32px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
}

.alert-success {
    background: #f0fdf4;
    color: #22c55e;
    border: 1px solid #dcfce7;
}

/* Pet Cards Grid */
.pets-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 30px;
    margin-top: 30px;
}

.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.pet-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.pet-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-light-hover);
}

.pet-card-header {
    background: linear-gradient(135deg, rgba(29, 212, 215, 0.05) 0%, rgba(29, 212, 215, 0.01) 100%);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.pet-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.pet-avatar i {
    width: 28px;
    height: 28px;
}

.pet-meta {
    display: flex;
    flex-direction: column;
}

.pet-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.pet-species-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--primary-light);
    color: var(--primary);
    margin-top: 4px;
}

.pet-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.pet-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.pet-detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.pet-detail-value {
    color: var(--text);
    font-weight: 600;
}

.pet-card-actions {
    padding: 16px 24px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.btn-delete-link {
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-delete-link:hover {
    color: #dc2626;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
}

.empty-state i {
    width: 48px;
    height: 48px;
    color: var(--border-hover);
    margin-bottom: 16px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .pets-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 24px;
        padding-top: 80px;
    }

    .menu-toggle {
        display: flex;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .user-profile-widget {
        align-self: flex-end;
    }
}
