/* NewMind Operations Portal - Main Styles */

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER / NAVIGATION ===== */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    height: 50px;
    background: white;
    padding: 5px 15px;
    border-radius: 8px;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.85rem;
    opacity: 0.9;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* ===== NAVIGATION MENU ===== */
.main-nav {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
}

.nav-menu li a {
    display: block;
    padding: 15px 18px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

/* Reports dropdown — click-to-toggle */
.nav-menu li.nav-dropdown {
    position: relative;
}

.nav-menu li.nav-dropdown > a {
    cursor: pointer;
}

.nav-menu li.nav-dropdown > ul.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 200px;
    z-index: 1000;
}

.nav-menu li.nav-dropdown.open > ul.dropdown-menu {
    display: block;
}

.nav-menu li.nav-dropdown > ul.dropdown-menu > li {
    list-style: none;
    display: block;
    margin: 0;
    padding: 0;
}

.nav-menu li.nav-dropdown > ul.dropdown-menu > li > a {
    padding: 10px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    display: block;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu li.nav-dropdown > ul.dropdown-menu > li:last-child > a {
    border-bottom: none;
}

.nav-menu li.nav-dropdown > ul.dropdown-menu > li > a:hover {
    background: #f0f2ff;
    color: #667eea;
}

.nav-menu li a.disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-menu li a.disabled:hover {
    color: #ccc;
    border-bottom-color: transparent;
    background: transparent;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    display: flex;
}

.login-left {
    flex: 1;
    padding: 50px;
    background: white;
}

.login-right {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-logo {
    max-width: 250px;
    margin-bottom: 30px;
    background: white;
    padding: 15px;
    border-radius: 10px;
}

.login-left h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.login-left p {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.login-right h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.login-right p {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.8;
}

.hero-image {
    max-width: 100%;
    margin-top: 20px;
    border-radius: 10px;
}

/* ===== DASHBOARD ===== */
.dashboard {
    padding: 30px 0;
}

.page-header h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-header p,
.page-header .subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-card.purple .stat-icon { color: #667eea; }
.stat-card.blue .stat-icon { color: #4299e1; }
.stat-card.green .stat-icon { color: #48bb78; }
.stat-card.orange .stat-icon { color: #ed8936; }

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.purple { border-left: 4px solid #667eea; }
.stat-card.blue { border-left: 4px solid #4299e1; }
.stat-card.green { border-left: 4px solid #48bb78; }
.stat-card.orange { border-left: 4px solid #ed8936; }

.welcome-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.welcome-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.welcome-card p {
    color: #666;
    line-height: 1.8;
}

/* ===== ACTION TILES ===== */
.action-tiles {
    margin-bottom: 30px;
}

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.action-tile {
    background: white;
    padding: 30px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    display: block;
    text-align: center;
    border: 2px solid transparent;
}

.action-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
}

.action-tile.purple-tile {
    border-color: #6f42c1;
}

.action-tile.purple-tile:hover {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
}

.action-tile.gray-tile {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.action-tile.disabled-tile {
    cursor: not-allowed;
    opacity: 0.6;
}

.action-tile.disabled-tile:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.tile-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.action-tile.purple-tile .tile-icon {
    color: #6f42c1;
}

.action-tile.purple-tile:hover .tile-icon {
    color: white;
}

.tile-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.action-tile.purple-tile:hover .tile-title {
    color: white;
}

.tile-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.action-tile.purple-tile:hover .tile-description {
    color: rgba(255, 255, 255, 0.9);
}

.action-tile.disabled-tile .tile-description {
    color: #999;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.alert-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.alert-info {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

/* ===== ERROR DISPLAY ===== */
.error-details {
    background: #fff3cd;
    border: 3px solid #dc3545;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-details h3 {
    color: #dc3545;
    margin-top: 0;
    margin-bottom: 15px;
}

.error-content {
    background: white;
    padding: 15px;
    border: 1px solid #856404;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@@media (max-width: 768px) {
    .login-box {
        flex-direction: column;
    }

    .login-left,
    .login-right {
        padding: 30px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .user-section {
        flex-direction: column;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-menu li a {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .nav-menu li a:hover,
    .nav-menu li a.active {
        border-left-color: #667eea;
    }
}

/* ========================================
   LIST PAGE STYLES (filters, tables, buttons)
   ======================================== */

/* Page header with action button */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.page-header .header-left {
    flex: 1;
}

/* Filter Form */
.filter-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.filter-group .form-control {
    width: auto;
    min-width: 150px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.filter-group .btn {
    margin-top: 0;
}

/* Buttons (override login-page width:100%) */
.filter-form .btn-primary,
.filter-form .btn-secondary,
.page-header .btn-primary,
.page-header .btn-secondary,
.table .btn,
.btn-sm {
    width: auto;
    display: inline-block;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
    text-decoration: none;
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-danger.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* Filter-form button sizing */
.filter-form .btn-primary {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* Results info bar */
.results-info {
    padding: 10px 0;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Table styles */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table th {
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    color: #333;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table .text-center {
    text-align: center;
}

.table a {
    color: #667eea;
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Checkbox styling in filter forms */
.filter-group input[type="checkbox"] {
    width: auto;
    min-width: auto;
    margin-right: 6px;
    vertical-align: middle;
}

/* Inline form for deactivate buttons */
.table form {
    display: inline;
}

/* Responsive for filter forms */
@@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group .form-control {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
    }
}

/* ========================================
   NOTES SECTION STYLES
   ======================================== */

/* Notes List Container */
.notes-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Individual Note Item */
.note-item {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.note-item:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Note Header */
.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.note-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-author i {
    font-size: 1.2em;
    color: #6c757d;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Note Body */
.note-body {
    color: #495057;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Add Note Section */
.add-note-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    border: 2px dashed #dee2e6;
}

.add-note-section h6 {
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

.add-note-section h6 i {
    color: #28a745;
}

/* Note Type Badges */
.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: #fff;
}

.badge-info {
    background-color: #17a2b8;
    color: #fff;
}

.badge-secondary {
    background-color: #6c757d;
    color: #fff;
}

/* Card Header Teal (for Notes card) */
.card-header-teal {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.card-header-teal i {
    color: rgba(255, 255, 255, 0.9);
}

/* Scrollbar styling for notes list */
.notes-list::-webkit-scrollbar {
    width: 8px;
}

.notes-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.notes-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.notes-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   SEARCHABLE DROPDOWN COMPONENT
   ======================================== */

.searchable-dropdown-wrapper {
    position: relative;
}

.searchable-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.searchable-dropdown-panel.open {
    display: block;
}

.searchable-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.searchable-dropdown-item:hover,
.searchable-dropdown-item.active {
    background-color: #007bff;
    color: white;
}

.searchable-dropdown-no-results {
    padding: 8px 12px;
    color: #999;
    font-style: italic;
    font-size: 14px;
}
