/* CyberOne Security Awareness Portal - Stylesheet */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.nav-brand-section {
    padding: 20px 30px;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav-logout-mobile {
    display: none !important;
}

.nav-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.nav-logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.nav-brand-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 20px;
}

.nav-logout-desktop {
    display: none;
}

.nav-actions {
    display: none;
}

@media (min-width: 769px) {
    .nav-logout-desktop {
        display: flex;
    }
}

/* Hamburger Menu Button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.nav-hamburger span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.nav-hamburger-open span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-hamburger-open span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger-open span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 1.2rem;
    display: inline-block;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown .nav-link {
    white-space: nowrap;
}

.nav-dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 4px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.nav-dropdown:hover .nav-dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    width: max-content;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 8px 0;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    color: var(--primary-color);
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
    min-width: 0;
}

.nav-dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    color: #667eea;
    padding-left: 23px;
}

.nav-dropdown-item.active {
    background: rgba(102, 126, 234, 0.15);
    border-left-color: #667eea;
    color: #667eea;
}

.nav-user-info {
    padding: 0 15px;
    margin: 0 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.nav-user-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.nav-user {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-logout {
    background: rgba(231, 76, 60, 0.2) !important;
    border-color: rgba(231, 76, 60, 0.4) !important;
}

.nav-logout:hover {
    background: rgba(231, 76, 60, 0.4) !important;
    border-color: rgba(231, 76, 60, 0.6) !important;
}

.nav-role-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-role-badge.badge-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.nav-role-badge.badge-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.nav-role-badge.badge-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-brand-section {
        justify-content: space-between;
        padding: 15px 20px;
    }
    
    .nav-logo-wrapper {
        flex: 0 0 auto;
    }
    
    .nav-hamburger {
        display: flex;
        position: static;
        transform: none;
        flex: 0 0 auto;
    }
    
    .nav-logout-mobile {
        display: flex !important;
        flex: 0 0 auto;
        margin: 0 10px;
        white-space: nowrap;
    }
    
    /* Ensure mobile logout button matches desktop appearance exactly - same padding, font size, etc */
    .nav-logout-mobile,
    .nav-logout-mobile:hover {
        padding: 12px 20px;
        font-size: 0.95rem;
        font-weight: 600;
        background: rgba(231, 76, 60, 0.2) !important;
        border-color: rgba(231, 76, 60, 0.4) !important;
        border: 2px solid rgba(231, 76, 60, 0.4);
    }
    
    .nav-logout-mobile:hover {
        background: rgba(231, 76, 60, 0.4) !important;
        border-color: rgba(231, 76, 60, 0.6) !important;
    }
    
    .nav-logout-mobile .nav-icon {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
        max-height: 0;
        overflow: hidden;
        padding: 0 20px;
        transition: max-height 0.3s ease, padding 0.3s ease;
        opacity: 0;
        visibility: hidden;
    }
    
    .nav-menu.nav-menu-open {
        max-height: 1000px;
        padding: 15px 20px;
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
    }
    
    /* Override width for mobile logout button - should match desktop width */
    .nav-brand-section .nav-logout-mobile {
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 8px;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: rgba(102, 126, 234, 0.1);
        backdrop-filter: blur(5px);
    }
    
    .nav-dropdown-item {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .nav-dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        border-left: none;
        border-top-color: rgba(255, 255, 255, 0.3);
        color: white;
        padding-left: 20px;
    }
    
    .nav-dropdown-item.active {
        background: rgba(255, 255, 255, 0.15);
        border-left: none;
        border-top-color: rgba(255, 255, 255, 0.4);
        color: white;
    }
    
    .nav-dropdown-item:first-child {
        border-top: none;
    }
    
    .nav-user-info {
        border-left: none;
        border-right: none;
        border-top: 2px solid rgba(255, 255, 255, 0.3);
        border-bottom: 2px solid rgba(255, 255, 255, 0.3);
        padding: 15px;
        margin: 10px 0;
    }
    
    .nav-brand-text {
        font-size: 1.4rem;
    }
    
    .nav-logo {
        height: 50px !important;
    }
}

/* Login Page */
.login-box {
    max-width: 400px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo-container {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    max-width: 150px;
    height: auto;
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fee;
    color: var(--error-color);
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: var(--success-color);
    border: 1px solid #cfc;
}

/* Dashboard */
h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--primary-color);
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Quiz Cards */
.quiz-list {
    display: grid;
    gap: 15px;
}

.quiz-card {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #f8f9fa;
}

.quiz-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.quiz-meta {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #666;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-error {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.badge-card {
    text-align: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #f8f9fa;
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.badge-card h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.badge-card p {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 10px;
}

.badge-card small {
    color: #999;
    font-size: 0.75rem;
}

/* Settings Form */
.settings-form {
    max-width: 600px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr; /* or multiple columns if needed */
  gap: 20px;
}

.dashboard-section {
  background: #fff; /* optional for clarity */
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto; /* ensures table stays inside */
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.data-table thead {
  background-color: #f5f5f5; /* highlight headers */
  position: sticky; /* keeps headers visible if scrolling */
  top: 0;
}
}

