/* NodeWorks Shared Styles */

/* CSS Variables */
:root {
    --color-dark: #35353D;
    --color-dark-lighter: #1a1a1f;
    --color-orange: #F2A84C;
    --color-coral: #D94841;
    --color-white: #FFFFFF;
    --color-gray: #666;
    --color-light-gray: #F9F9F9;
    --color-border: #f0f0f0;
    --gradient-primary: linear-gradient(135deg, #F2A84C 0%, #D94841 100%);
    --shadow-sm: 0 2px 12px rgba(53, 53, 61, 0.08);
    --shadow-md: 0 5px 30px rgba(53, 53, 61, 0.08);
    --shadow-lg: 0 20px 50px rgba(53, 53, 61, 0.12);
    --shadow-glow: 0 4px 15px rgba(242, 168, 76, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--color-dark);
    line-height: 1.6;
    background: var(--color-white);
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--color-orange);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-coral);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(242, 168, 76, 0.5);
    color: var(--color-white);
}

.btn-secondary {
    background: transparent;
    color: var(--color-dark);
    border: 2px solid var(--color-dark);
}

.btn-secondary:hover {
    background: var(--color-dark);
    color: var(--color-white);
}

.btn-outline-light {
    background: transparent;
    color: var(--color-white);
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
    color: var(--color-white);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 13px;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-dark);
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    color: var(--color-dark);
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 0 0 0 4px rgba(242, 168, 76, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 13px;
    color: var(--color-gray);
    margin-top: 6px;
}

.form-error {
    font-size: 13px;
    color: var(--color-coral);
    margin-top: 6px;
}

/* Cards */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-dark);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new { background: #E3F2FD; color: #1565C0; }
.badge-reviewing { background: #FFF3E0; color: #E65100; }
.badge-planning { background: #F3E5F5; color: #7B1FA2; }
.badge-in-progress { background: #FFF8E1; color: #F57F17; }
.badge-review { background: #E8F5E9; color: #2E7D32; }
.badge-completed { background: #E8F5E9; color: #2E7D32; }
.badge-open { background: #FFEBEE; color: #C62828; }
.badge-resolved { background: #E8F5E9; color: #2E7D32; }
.badge-closed { background: #ECEFF1; color: #546E7A; }

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-light-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-lighter) 100%);
    padding: 120px 60px 60px;
    color: var(--color-white);
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 16px;
    opacity: 0.8;
}

/* Navbar */
.navbar {
    background: var(--color-dark);
    padding: 20px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.navbar .logo {
    height: 50px;
}

.navbar-nav {
    display: flex;
    gap: 30px;
    align-items: center;
    list-style: none;
}

.navbar-nav a {
    color: var(--color-white);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.navbar-nav a:hover {
    color: var(--color-orange);
    opacity: 1;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-white);
    font-size: 14px;
}

.navbar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Main Content */
.main-content {
    padding: 40px 60px;
    min-height: calc(100vh - 200px);
}

/* Grid System */
.grid {
    display: grid;
    gap: 30px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

    .navbar {
        padding: 15px 25px;
    }

    .page-header {
        padding: 100px 25px 40px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .main-content {
        padding: 30px 25px;
    }
}

/* Stats Cards */
.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-white);
    stroke-width: 2;
    fill: none;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-dark);
}

.stat-card-label {
    font-size: 14px;
    color: var(--color-gray);
    margin-top: 5px;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-gray);
    background: var(--color-light-gray);
}

.table tr:hover td {
    background: var(--color-light-gray);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--color-dark);
    margin-bottom: 10px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.alert-warning {
    background: #FFF8E1;
    color: #F57F17;
    border: 1px solid #FFE082;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-gray);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--color-dark);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--gradient-primary);
    border-radius: 50%;
}

.timeline-date {
    font-size: 12px;
    color: var(--color-gray);
    margin-bottom: 5px;
}

.timeline-content {
    font-size: 14px;
    color: var(--color-dark);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-gray); }
.text-success { color: #2E7D32; }
.text-error { color: #C62828; }
.text-warning { color: #F57F17; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Footer for portal pages */
.portal-footer {
    background: var(--color-dark);
    color: var(--color-white);
    padding: 30px 60px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

/* ==========================================
   HAMBURGER MENU
   ========================================== */

/* Hamburger Toggle Button - Hidden on Desktop */
.hamburger-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
}

.hamburger-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-orange);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-toggle.active .hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-toggle.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.hamburger-toggle.active .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--color-dark);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.3s ease;
}

.mobile-menu-close:hover {
    color: var(--color-orange);
}

.mobile-menu-links {
    list-style: none;
    padding: 15px 0;
    flex: 1;
}

.mobile-menu-links a {
    display: block;
    padding: 14px 25px;
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mobile-menu-links a:hover,
.mobile-menu-links a.active {
    color: var(--color-white);
    background: rgba(255,255,255,0.05);
    border-left-color: var(--color-orange);
}

.mobile-menu-links a.mobile-cta {
    margin: 10px 25px;
    padding: 14px 24px;
    background: var(--gradient-primary);
    color: var(--color-white);
    border-radius: var(--radius-full);
    text-align: center;
    border-left: none;
}

.mobile-menu-links a.mobile-cta:hover {
    background: var(--gradient-primary);
    border-left: none;
}

.mobile-menu-user {
    padding: 20px 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.mobile-menu-user a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    margin-left: auto;
    font-size: 13px;
}

.mobile-menu-user a:hover {
    color: var(--color-orange);
}

/* Responsive - Show hamburger, hide desktop nav, shrink logo */
@media (max-width: 768px) {
    .hamburger-toggle {
        display: flex;
    }

    .nav-links {
        display: none !important;
    }

    .navbar-nav,
    .navbar-user {
        display: none !important;
    }

    .admin-nav-links,
    .admin-user {
        display: none !important;
    }

    .logo {
        height: 35px !important;
    }

    body.menu-open {
        overflow: hidden;
    }
}
