/**
 * Resume Blossom Modern Admin UI
 * Clean, modern design inspired by wrike-message-editor
 * Hamburger navigation, improved typography, card-based layouts
 */

/* ========================================
   RESET OLD BOOTSTRAP LAYOUTS
   ======================================== */

/* Remove fixed sidebar padding */
body.expanded-nav,
body.collapsed-nav {
    padding-left: 0 !important;
}

body.expanded-nav .navbar-fixed-top,
body.expanded-nav .navbar-fixed-bottom,
body.collapsed-nav .navbar-fixed-top,
body.collapsed-nav .navbar-fixed-bottom {
    left: 0 !important;
}

/* Hide old fixed footer */
#footer-bar {
    display: none !important;
}

/* Remove bottom padding for old footer */
body {
    padding-bottom: 0 !important;
}

/* ========================================
   MODERN TYPOGRAPHY
   ======================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    background: #f9fafb;
    padding-top: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    color: #1f2937;
}

/* ========================================
   HAMBURGER NAVIGATION
   ======================================== */

#main-nav {
    position: fixed;
    left: -280px;
    width: 280px;
    height: 100%;
    top: 60px;
    background: #2d3748 !important;
    z-index: 1999;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Override Bootstrap's .nav background */
#main-nav .nav {
    background: transparent !important;
    margin: 0 !important;
}

#main-nav.open {
    left: 0;
}

/* Navigation Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 1998;
}

.nav-overlay.active {
    display: block;
}

/* Nav Items - Override Bootstrap with exact selectors */
#main-nav .nav > li > a {
    padding: 14px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    border-left: 3px solid transparent !important;
    position: relative;
    color: #e2e8f0 !important;
    background: transparent !important;
}

#main-nav .nav > li > a:hover,
#main-nav .nav > li > a:focus,
#main-nav .nav > li:hover > a {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

#main-nav .nav > li.active > a,
#main-nav .nav > li.active > a:hover,
#main-nav .nav > li.active > a:focus {
    background: #4a5568 !important;
    border-left-color: #EF8312 !important;
    color: #fff !important;
}

/* Override expanded-nav specific rules */
body.expanded-nav #main-nav .nav > li.active .dropdown-menu,
body.rb-admin #main-nav .nav > li.active .dropdown-menu {
    display: none !important;
    position: static !important;
}

body.expanded-nav #main-nav .nav > li.active.open .dropdown-menu,
body.rb-admin #main-nav .nav > li.active.open .dropdown-menu {
    display: block !important;
}

/* Dropdown toggle chevron */
#main-nav .dropdown > a.dropdown-toggle::after {
    content: '\e080';
    font-family: 'Glyphicons Halflings';
    font-size: 10px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.2s ease;
}

#main-nav .dropdown.open > a.dropdown-toggle::after {
    transform: translateY(-50%) rotate(90deg);
}

/* Logo in Nav */
#main-nav #navbar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dropdown menus in nav - click to toggle, not hover */
#main-nav .dropdown-menu {
    position: static !important;
    float: none !important;
    box-shadow: none !important;
    background: #1a202c !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
}

#main-nav .dropdown.open .dropdown-menu {
    display: block !important;
}

#main-nav .dropdown-menu > li > a {
    padding-left: 40px !important;
    color: #cbd5e0 !important;
    background: transparent !important;
}

#main-nav .dropdown-menu > li > a:hover {
    background: rgba(239, 131, 18, 0.15) !important;
    color: #fff !important;
}

/* Force disable hover behavior on dropdowns */
#main-nav .dropdown:hover .dropdown-menu {
    display: none !important;
}

#main-nav .dropdown.open:hover .dropdown-menu {
    display: block !important;
}

/* Prevent Bootstrap's hover-based dropdown from interfering */
#main-nav .dropdown:hover > .dropdown-menu {
    display: none !important;
}

#main-nav .dropdown.open:hover > .dropdown-menu {
    display: block !important;
}

/* ========================================
   MODERN TOP BAR
   ======================================== */

.rb-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    z-index: 1100;
}

.rb-top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rb-hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1B566C;
    transition: background 0.2s;
    border-radius: 6px;
}

.rb-hamburger-btn:hover {
    background: #f9fafb;
}

.rb-hamburger-icon {
    width: 24px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rb-hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background: #1B566C;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.rb-hamburger-btn.active .rb-hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.rb-hamburger-btn.active .rb-hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.rb-hamburger-btn.active .rb-hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.rb-top-bar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rb-top-bar-logo img {
    height: 30px;
    width: auto;
}

.rb-top-bar-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.rb-top-bar-user {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 24px;
}

.rb-user-welcome {
    font-size: 14px;
    color: #6b7280;
}

.rb-user-welcome strong {
    color: #EF8312;
    font-weight: 600;
}

.rb-top-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rb-action-btn {
    padding: 8px 16px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.rb-action-btn.rb-action-avatar {
    padding: 6px 12px 6px 6px;
    border-color: transparent;
    background: none;
}

.rb-action-btn.rb-action-avatar:hover {
    background: transparent;
}

.rb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    aspect-ratio: 1 / 1;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    overflow: hidden;
    background: #6b7280;
    flex-shrink: 0;
    position: relative;
    line-height: 36px;
    text-align: center;
}

.rb-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.rb-avatar-fallback {
    border-radius: 50%;
    letter-spacing: 0.02em;
    line-height: 1;
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rb-action-btn:hover {
    background: #f9fafb;
    color: #1B566C;
    text-decoration: none;
}

.rb-action-btn.logout {
    color: #BE1E2D;
    border-color: #BE1E2D;
}

.rb-action-btn.logout:hover {
    background: #fee2e2;
    color: #7f1d1d;
}

/* ========================================
   MAIN CONTENT LAYOUT
   ======================================== */

.rb-main-content {
    min-height: 100vh;
    background: #f9fafb;
}

.rb-content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Login page needs top padding since it doesn't have the header elements */
body.no-menu .rb-content-container {
    padding-top: 80px;
}

body.no-menu .rb-main-content {
    padding-top: 60px;
}

/* Hide entire nav and hamburger on login page */
body.no-menu .rb-hamburger-btn {
    display: none !important;
}

body.no-menu #main-nav {
    display: none !important;
}

body.no-menu .nav-overlay {
    display: none !important;
}

/* Modern Page Header */
.rb-page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.rb-page-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rb-page-header h1 .glyphicon {
    color: #EF8312;
    font-size: 24px;
}

.rb-page-header small {
    font-size: 16px;
    color: #6b7280;
    font-weight: 400;
    margin-left: 8px;
}

/* Override old page-header */
.page-header {
    border: none;
    padding-bottom: 15px;
    margin: 0 0 25px 0;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 600;
    color: #1f2937;
}

/* ========================================
   MODERN CARD COMPONENTS
   ======================================== */

.rb-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 20px;
}

.rb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.rb-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.rb-card-body {
    padding: 0;
}

/* Modern Panel Styling (override Bootstrap panels) */
.panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 20px;
}

.panel-heading {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
}

.panel-heading h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.panel-body {
    padding: 20px;
}

/* ========================================
   MODERN TABLES
   ======================================== */

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: #f9fafb;
}

.table thead > tr > th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    border-bottom: 2px solid #e5e7eb;
}

.table tbody > tr > td {
    padding: 16px;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.table tbody > tr:hover {
    background: #f9fafb;
}

/* ========================================
   MODERN FORMS
   ======================================== */

.form-control {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: #374151;
}

.form-control:focus {
    border-color: #EF8312;
    box-shadow: 0 0 0 3px rgba(239, 131, 18, 0.1);
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* ========================================
   MODERN BUTTONS
   ======================================== */

.btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-primary {
    background: #EF8312;
    border-color: #EF8312;
}

.btn-primary:hover {
    background: #dc7006;
    border-color: #dc7006;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 131, 18, 0.3);
}

.btn-default {
    background: white;
    border-color: #d1d5db;
    color: #374151;
}

.btn-default:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-success {
    background: #00AC53;
    border-color: #00AC53;
}

.btn-danger {
    background: #BE1E2D;
    border-color: #BE1E2D;
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */

.alert {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: none;
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

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

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Messages Container - Collapse when empty */
#Messages {
    min-height: 0;
    margin: 0;
}

#Messages:empty {
    display: none;
}

/* System Messages */
.system-alert {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    color: #1e40af;
}

.system-alert.client-alert {
    background: #fef3c7;
    border-color: #fde047;
    color: #92400e;
}

/* Hide system messages when empty (they have style="display:none;" by default) */
.system-alert:empty,
.system-alert[style*="display:none"],
.system-alert[style*="display: none"] {
    margin: 0;
    padding: 0;
    border: 0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile */
@media (max-width: 768px) {
    #main-nav {
        width: 100%;
        left: -100%;
    }
    
    #main-nav.open {
        left: 0;
    }
    
    .rb-content-container {
        padding: 20px 15px;
    }
    
    .rb-top-bar {
        padding: 0 15px;
    }
    
    .rb-user-welcome {
        display: none;
    }
    
    .rb-top-bar-title {
        font-size: 16px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .rb-content-container {
        max-width: 100%;
        padding: 25px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .rb-content-container {
        padding: 40px 30px;
    }
}

/* ========================================
   MODERN FILTERS & CONTROLS
   ======================================== */

.rb-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rb-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.rb-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.rb-filter-group select,
.rb-filter-group input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* ========================================
   LOADING STATES
   ======================================== */

.rb-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.rb-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #EF8312;
    border-radius: 50%;
    animation: rb-spin 1s linear infinite;
}

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

/* ========================================
   EMPTY STATES
   ======================================== */

.rb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.rb-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.rb-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

/* ========================================
   BADGES & LABELS
   ======================================== */

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.label {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.label-primary {
    background: #EF8312;
}

.label-success {
    background: #00AC53;
}

.label-info {
    background: #1B566C;
}

.label-warning {
    background: #f59e0b;
}

.label-danger {
    background: #BE1E2D;
}

/* ========================================
   UTILITIES
   ======================================== */

.rb-text-primary {
    color: #EF8312;
}

.rb-text-secondary {
    color: #6b7280;
}

.rb-text-muted {
    color: #9ca3af;
}

.rb-bg-light {
    background: #f9fafb;
}

.rb-shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rb-shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.rb-rounded {
    border-radius: 8px;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .rb-top-bar,
    #main-nav,
    .nav-overlay {
        display: none !important;
    }
    
    .rb-main-content {
        margin-top: 0;
    }
}

