/**
 * TQUMen Portal - Professional Design System
 * Strict design system for SaaS/University portal
 */

:root {
  --primary: #1e6f5c;
  --primary-hover: #185c4b;
  --primary-soft: #e6f2ef;

  --text-dark: #111827;
  --text-muted: #6b7280;

  --border: #e5e7eb;
  --background: #f9fafb;
  --white: #ffffff;

  --danger: #dc2626;
  --success: #16a34a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf2 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
    margin: 0 0 16px 0;
}

h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }
h5 { font-size: 15px; font-weight: 600; }
h6 { font-size: 14px; font-weight: 600; }

p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0 0 16px 0;
}

/* Navigation Bar */
.navbar {
    background: var(--primary) !important;
    border-bottom: 2px solid var(--primary-hover) !important;
    height: 64px !important;
    padding: 0 !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(30, 111, 92, 0.2);
}

.navbar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--white) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand:hover {
    color: var(--white) !important;
    opacity: 0.9;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-nav .nav-link:hover {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar-nav .nav-link.active {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid var(--white);
    font-weight: 600;
}

.navbar-nav .nav-link i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.navbar-nav .nav-link.active i,
.navbar-nav .nav-link:hover i {
    color: var(--white);
}

/* Navbar User Dropdown */
.navbar-user {
    display: flex;
    align-items: center;
}

.navbar-user .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-user .nav-link:hover {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.15);
}

.navbar-user .nav-link i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
}

.navbar-user .nav-link:hover i {
    color: var(--white);
}

.navbar-user .profile-photo-small {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Bootstrap Dropdown Menu - override for green navbar */
.navbar .dropdown-menu {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
    padding: 8px 0;
}

.navbar .dropdown-item {
    color: var(--text-dark);
    padding: 10px 20px;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .dropdown-item:hover {
    background-color: var(--primary-soft);
    color: var(--primary);
}

.navbar .dropdown-item i {
    color: var(--text-muted);
    width: 18px;
    text-align: center;
}

.navbar .dropdown-item:hover i {
    color: var(--primary);
}

.navbar .dropdown-divider {
    margin: 8px 0;
    border-color: var(--border);
}

/* Home page navbar - keep green gradient */
.navbar.home-navbar {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c2a 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.navbar.home-navbar .navbar-brand {
    color: white !important;
}

.navbar.home-navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar.home-navbar .navbar-nav .nav-link:hover,
.navbar.home-navbar .navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar.home-navbar .navbar-nav .nav-link i {
    color: rgba(255, 255, 255, 0.9);
}

/* Main Content */
main {
    flex: 1;
    padding: 15px 0px;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* Three-column layout for authenticated pages */
.container.layout-three-column {
    display: grid !important;
    gap: 24px;
    max-width: 1200px !important;
    padding: 15px 15px !important;
    margin: 0 auto !important;
    align-items: start;
}

.container.layout-three-column.has-right-sidebar {
    grid-template-columns: 280px 1fr 280px;
}

.container.layout-single {
    max-width: 1200px !important;
    padding: 15px 15px !important;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(30, 111, 92, 0.08);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(30, 111, 92, 0.12);
    transform: translateY(-2px);
    border-left-color: var(--primary-light);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding: 12px 16px;
    margin: -24px -24px 16px -24px;
    border-bottom: 2px solid var(--primary-soft);
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to right, var(--primary-ultra-soft), transparent);
    border-radius: 14px 14px 0 0;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.card-header i {
    font-size: 16px;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 6px;
    border-radius: 8px;
}

.card-body {
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: var(--white) !important;
    box-shadow: 0 4px 12px rgba(30, 111, 92, 0.25);
    border: 2px solid var(--primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--white);
    color: var(--primary) !important;
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(30, 111, 92, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(30, 111, 92, 0.15);
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(30, 111, 92, 0.25);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(30, 111, 92, 0.1);
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(30, 111, 92, 0.25);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    border: none;
    font-weight: 500;
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d 0%, var(--success) 100%);
    color: var(--white);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    border: none;
    font-weight: 500;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, var(--danger) 100%);
    color: var(--white);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn i {
    font-size: 16px;
}

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

label,
.form-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.required-field::after {
    content: " *";
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea,
.form-control,
.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-dark);
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-soft), 0 2px 8px rgba(30, 111, 92, 0.1);
    background: var(--white);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.form-check-input {
    width: auto;
    margin: 0;
}

.form-check-label {
    margin: 0;
    font-size: 14px;
    color: var(--text-dark);
}

/* Sidebar */
.sidebar-left,
.sidebar-right {
    position: sticky;
    top: 80px;
    height: fit-content;
    align-self: start;
}

.sidebar-menu {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.sidebar-menu-item:hover {
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--primary-ultra-soft) 100%);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(30, 111, 92, 0.1);
}

.sidebar-menu-item i {
    font-size: 16px;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.sidebar-menu-item:hover i {
    color: var(--primary);
}

/* Main Content Area */
.main-content {
    min-width: 0;
}

/* Profile Photos */
.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-photo-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
}

.profile-photo-medium {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--primary-ultra-soft) 100%);
    color: var(--primary);
    border: 1px solid var(--primary-soft);
    font-weight: 600;
}

.badge-secondary {
    background: var(--background);
    color: var(--text-muted);
}

.badge-success {
    background: #dcfce7;
    color: var(--success);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-soft) 0%, #fde68a 100%);
    color: #d97706;
    border: 1px solid #fcd34d;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.alert-success {
    background: #dcfce7;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.alert-error,
.alert-danger {
    background: linear-gradient(135deg, var(--danger-soft) 0%, #fecaca 100%);
    color: var(--danger);
    border: 2px solid #fca5a5;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-info {
    background: linear-gradient(135deg, var(--info-soft) 0%, #bfdbfe 100%);
    color: var(--info);
    border: 2px solid #93c5fd;
    border-left: 4px solid var(--info);
}

.alert i {
    font-size: 16px;
    color: inherit;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 16px rgba(30, 111, 92, 0.08);
}

.table thead {
    background: var(--background);
}

.table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-dark);
}

.table tbody tr:hover {
    background: var(--primary-ultra-soft);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Directory Grid */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.directory-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary-soft);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(30, 111, 92, 0.08);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.directory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.directory-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(30, 111, 92, 0.15);
    border-color: var(--primary);
    background: linear-gradient(to bottom, var(--white) 0%, var(--primary-ultra-soft) 100%);
}

.directory-item:hover::before {
    transform: scaleX(1);
}

.directory-item .profile-photo {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.directory-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
}

.directory-item .profession {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.directory-item .city {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    background: var(--white);
}

.pagination a:hover {
    background: var(--primary-ultra-soft);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(30, 111, 92, 0.15);
}

.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 32px 0;
    margin-top: 64px;
    text-align: center;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-100 { width: 100%; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

/* Remove gaps at top of grid columns */
.container.layout-three-column > * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.container.layout-three-column .sidebar-left,
.container.layout-three-column .main-content,
.container.layout-three-column .sidebar-right {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.container.layout-three-column .sidebar-left > *:first-child,
.container.layout-three-column .main-content > *:first-child,
.container.layout-three-column .sidebar-right > *:first-child {
    margin-top: 0 !important;
}

.container.layout-three-column .sidebar-menu {
    margin-top: 0 !important;
}

/* Row and Column Utilities */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    gap: 24px;
}

.col-md-4,
.col-md-6,
.col-md-8,
.col-md-12 {
    flex: 1;
    min-width: 0;
}

.col-md-4 {
    flex: 0 0 calc(33.333% - 16px);
    max-width: calc(33.333% - 16px);
}

.col-md-6 {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
}

.col-md-8 {
    flex: 0 0 calc(66.666% - 16px);
    max-width: calc(66.666% - 16px);
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Responsive Design */
@media (max-width: 992px) {
    .container.layout-three-column {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }
    
    .sidebar-left,
    .sidebar-right {
        position: static !important;
    }
    
    .directory-grid {
        grid-template-columns: 1fr;
    }
    
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    main {
        padding: 15px 0;
    }
    
    .container.layout-three-column,
    .container.layout-single {
        padding: 15px 15px !important;
    }
    
    .card {
        padding: 16px;
    }
    
    .btn {
        width: 100%;
    }
    
    .navbar {
        height: auto !important;
        min-height: 64px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
    }
    
    .row {
        gap: 16px;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
