/*
* Portfolio Website - Admin Panel CSS
* A feminine yet professional admin design
*/

/* ------------------------------------------------
   Variables and Base Styles
   ------------------------------------------------ */
:root {
    /* Color Palette - Admin Theme (Feminine & Professional) */
    --primary-color: #b76e79; /* Soft rose */
    --primary-light: #f0d4d8; /* Very light rose */
    --primary-dark: #8e5058; /* Darker rose */
    --secondary-color: #8a6a94; /* Lavender purple */
    --secondary-light: #e8dff0; /* Very light purple */
    --accent-color: #d2a7be; /* Soft pink */
    
    /* Neutral Colors */
    --dark: #343a40;
    --text-dark: #2e2e2e;
    --text-medium: #666666;
    --text-light: #999999;
    --border-color: #e9ecef;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    
    /* Semantic Colors */
    --success: #7ec588;
    --info: #6ab0de;
    --warning: #f0ad4e;
    --danger: #d9534f;
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Poppins', sans-serif;
    
    /* Sizing and Spacing */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --border-radius: 0.25rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    
    /* Transitions */
    --transition-speed: 0.3s;
}

body {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f6f6f6;
    min-height: 100vh;
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ------------------------------------------------
   Admin Layout
   ------------------------------------------------ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-content {
    flex-grow: 1;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: margin var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.content-area {
    flex-grow: 1;
    padding: 1.5rem;
    background-color: #f6f6f6;
}

/* ------------------------------------------------
   Sidebar Navigation
   ------------------------------------------------ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    z-index: 1030;
    transition: width var(--transition-speed);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.sidebar-toggler {
    display: none;
    background: none;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 1.25rem;
}

.sidebar-user {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: var(--primary-dark);
    font-size: 1.25rem;
}

.user-details h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.user-details span {
    font-size: 0.8rem;
    color: var(--text-medium);
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem 0;
    overflow-y: auto;
    list-style: none;
    margin: 0;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--text-medium);
    border-left: 3px solid transparent;
    transition: all var(--transition-speed);
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
    text-align: center;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-left-color: var(--primary-color);
}

.nav-link .badge {
    margin-left: auto;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
}

/* ------------------------------------------------
   Top Navigation
   ------------------------------------------------ */
.admin-topnav {
    height: var(--header-height);
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    margin-right: 1rem;
}

.topnav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.dropdown-toggle:hover {
    color: var(--primary-color);
}

.dropdown-toggle i {
    font-size: 1.25rem;
}

/* ------------------------------------------------
   Dashboard Cards & Stats
   ------------------------------------------------ */
.page-title {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.stats-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.stats-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.stats-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.stats-link {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.stats-link:hover {
    color: var(--primary-dark);
}

/* ------------------------------------------------
   Forms & Controls
   ------------------------------------------------ */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control {
    border-color: var(--border-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(183, 110, 121, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(183, 110, 121, 0.25);
}

.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
}

/* ------------------------------------------------
   Tables
   ------------------------------------------------ */
.table th {
    font-weight: 600;
    color: var(--text-dark);
    background-color: var(--light-gray);
    border-top: none;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(240, 212, 216, 0.1);
}

.message-table .unread {
    background-color: rgba(240, 212, 216, 0.2);
    font-weight: 500;
}

.message-sender {
    line-height: 1.3;
}

.sender-name {
    font-weight: 500;
}

.sender-email {
    font-size: 0.85rem;
}

.message-subject {
    font-weight: 500;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.25rem;
}

.message-preview {
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* Project thumbnails in admin */
.project-thumbnail-sm {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.project-thumbnail-placeholder {
    width: 60px;
    height: 40px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-thumbnail {
    height: 180px;
    object-fit: cover;
}

/* ------------------------------------------------
   Buttons & Alerts
   ------------------------------------------------ */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.alert-success {
    background-color: rgba(126, 197, 136, 0.15);
    border-color: rgba(126, 197, 136, 0.3);
    color: #3d7a45;
}

.alert-danger {
    background-color: rgba(217, 83, 79, 0.15);
    border-color: rgba(217, 83, 79, 0.3);
    color: #a7423e;
}

.alert-info {
    background-color: rgba(106, 176, 222, 0.15);
    border-color: rgba(106, 176, 222, 0.3);
    color: #4484a7;
}

.alert-warning {
    background-color: rgba(240, 173, 78, 0.15);
    border-color: rgba(240, 173, 78, 0.3);
    color: #c08a2e;
}

/* ------------------------------------------------
   Admin Footer
   ------------------------------------------------ */
.admin-footer {
    padding: 1rem 1.5rem;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-medium);
}

/* ------------------------------------------------
   Login Page
   ------------------------------------------------ */
.login-page {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
}

.login-form {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.toggle-password {
    cursor: pointer;
}

/* ------------------------------------------------
   Media Queries
   ------------------------------------------------ */
@media (max-width: 991.98px) {
    .admin-content {
        width: 100%;
        margin-left: 0;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar-visible .admin-sidebar {
        transform: translateX(0);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar-toggler,
    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .content-area {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .admin-topnav {
        position: relative !important;
        flex-direction: row !important;
        height: auto;
        padding: 0.5rem 0.5rem;
        text-align: left;
    }
    .admin-topnav .sidebar-toggle {
        position: absolute !important;
        left: 0.5rem !important;
        top: 0.5rem !important;
        margin: 0 !important;
        z-index: 1050;
    }
    .admin-topnav .container-fluid {
        padding: 0;
    }
    .admin-topnav .d-flex {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }
    .topnav-right {
        margin-left: auto;
        margin-top: 0;
    }
    .stats-card {
        margin-bottom: 1rem;
    }
}
