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

/* ------------------------------------------------
   Variables and Base Styles
   ------------------------------------------------ */
:root {
    /* Color Palette - Admin Theme (Dark & Masculine) */
    --primary-color: #2c2c2c; /* Dark charcoal/black */
    --primary-light: #4a4a4a; /* Medium gray */
    --primary-dark: #1a1a1a; /* Almost black */
    --secondary-color: #5d4e37; /* Dark brown/tan */
    --secondary-light: #8b7355; /* Medium brown */
    --accent-color: #6b5b47; /* Rich brown */
    
    /* Neutral Colors */
    --dark: #1a1a1a;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #757575;
    --border-color: #d0d0d0;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    
    /* 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: #f0f0f0;
    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: #f0f0f0;
}

/* ------------------------------------------------
   Sidebar Navigation
   ------------------------------------------------ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #1e1e1e;
    border-right: 1px solid #333;
    z-index: 1030;
    transition: transform var(--transition-speed);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

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

.sidebar-brand {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.25rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.sidebar-brand:hover {
    color: #ffffff;
    opacity: 0.8;
    text-decoration: none;
}

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

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-user {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #333;
    background-color: #252525;
}

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

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b5b47 0%, #4a4a4a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: #ffffff;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-details h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
}

.user-details span {
    font-size: 0.75rem;
    color: #999;
}

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

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

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

.nav-link:focus {
    color: #ccc;
    text-decoration: none;
}

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

.nav-link:hover {
    color: #ffffff;
    background-color: #333;
    text-decoration: none;
}

.nav-item.active .nav-link {
    color: #ffffff;
    background-color: #2c2c2c;
    border-left-color: var(--secondary-color);
    font-weight: 500;
}

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

.sidebar-footer {
    border-top: 1px solid #333;
    padding: 1rem 0;
    background-color: #1e1e1e;
}

.sidebar-footer .nav-link {
    color: #999;
}

.sidebar-footer .nav-link:hover {
    color: #ffffff;
    background-color: #2a2a2a;
}

/* ------------------------------------------------
   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);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.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(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    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(44, 44, 44, 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(44, 44, 44, 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(44, 44, 44, 0.05);
}

.message-table .unread {
    background-color: rgba(93, 78, 55, 0.1);
    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;
}

/* Blog thumbnails in admin */
.blog-thumbnail {
    height: 180px;
    object-fit: cover;
}

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

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

/* Project card style untuk konsistensi dengan blog card */
.project-card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* ------------------------------------------------
   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, #2c2c2c 0%, #3d3d3d 50%, #5d4e37 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.15);
    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;
        transition: transform 0.3s ease;
    }
    
    .sidebar-visible .admin-sidebar {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-header {
        padding: 1rem;
        min-height: var(--header-height);
    }
}

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

    /* Perbesar topnav di tablet/phone */
    .admin-topnav {
        padding: 0.75rem 0.75rem;
    }
    .admin-topnav .dropdown-toggle i {
        font-size: 1.5rem;
    }
    .admin-topnav .dropdown-toggle img {
        width: 32px !important;
        height: 32px !important;
    }
    .admin-topnav .sidebar-toggle {
        font-size: 1.75rem;
    }
}

@media (max-width: 575.98px) {
    .admin-topnav {
        position: relative !important;
        flex-direction: row !important;
        height: auto;
        padding: 0.9rem 0.75rem;
        text-align: left;
    }
    .admin-topnav .sidebar-toggle {
        position: absolute !important;
        left: 0.5rem !important;
        top: 0.5rem !important;
        margin: 0 !important;
        z-index: 1050;
        font-size: 2rem;
    }
    .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;
    }
    .admin-topnav .dropdown-toggle i {
        font-size: 1.6rem;
    }
    .admin-topnav .dropdown-toggle img {
        width: 34px !important;
        height: 34px !important;
    }
}

/* Tambahan perbesaran untuk layar kecil 480px dan 350px */
@media (max-width: 480px) {
    .admin-topnav {
        padding: 1rem 0.75rem;
    }
    .admin-topnav .sidebar-toggle {
        font-size: 2.2rem;
    }
    .admin-topnav .dropdown-toggle i {
        font-size: 1.7rem;
    }
    .admin-topnav .dropdown-toggle img {
        width: 36px !important;
        height: 36px !important;
    }
}

@media (max-width: 350px) {
    .admin-topnav .sidebar-toggle {
        font-size: 2.35rem;
    }
    .admin-topnav .dropdown-toggle i {
        font-size: 1.8rem;
    }
    .admin-topnav .dropdown-toggle img {
        width: 38px !important;
        height: 38px !important;
    }
}
