/* ============================================
   GlobalSpeed - Common Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary: #0f172a;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --accent-glow: rgba(6, 182, 212, 0.3);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --bg: #020617;
    --card: rgba(15, 23, 42, 0.8);
    --card-hover: rgba(15, 23, 42, 0.95);
    --border: rgba(148, 163, 184, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Background Effects
   ============================================ */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.grid-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ============================================
   Navigation (Bootstrap Custom)
   ============================================ */
.navbar-custom {
    background: rgba(2, 6, 23, 0.95) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar-custom.scrolled {
    padding: 0.5rem 0;
    background: rgba(2, 6, 23, 0.98) !important;
}

.navbar-custom .navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-custom .nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
    transition: color 0.3s;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--accent) !important;
}

.navbar-custom .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.navbar-custom .nav-link:hover::after,
.navbar-custom .nav-link.active::after {
    transform: scaleX(1);
}

.navbar-toggler {
    border-color: var(--border) !important;
    padding: 0.375rem 0.75rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28226, 232, 240, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ============================================
   Common Components
   ============================================ */

/* Cards */
.gs-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gs-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

.gs-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.gs-card-header i {
    color: var(--accent);
}

.gs-card-body {
    padding: 1.25rem;
}

/* Form Controls */
.form-control-custom {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    color: var(--text) !important;
    padding: 0.625rem 1rem !important;
    transition: all 0.3s ease !important;
}

.form-control-custom::placeholder {
    color: #64748b !important;
}

.form-control-custom:hover {
    border-color: rgba(6, 182, 212, 0.5) !important;
}

.form-control-custom:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15) !important;
    background: rgba(15, 23, 42, 0.8) !important;
}

.form-control-custom[readonly] {
    background: rgba(15, 23, 42, 0.4) !important;
    color: var(--text-muted) !important;
}

.form-control-custom.is-invalid {
    border-color: var(--danger) !important;
}

.form-control-custom.is-valid {
    border-color: var(--success) !important;
}

.form-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover)) !important;
    border: none !important;
    color: white !important;
    padding: 0.625rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
}

.btn-primary-custom:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary-custom {
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    padding: 0.625rem 1.5rem !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

.btn-secondary-custom:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.btn-success-custom {
    background: linear-gradient(135deg, var(--success), #059669) !important;
    border: none !important;
    color: white !important;
    padding: 0.625rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger), #dc2626) !important;
    border: none !important;
    color: white !important;
    padding: 0.625rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-danger-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* Breadcrumb */
.breadcrumb-custom {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-custom a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-custom a:hover {
    color: var(--accent);
}

.breadcrumb-custom .active {
    color: var(--accent);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.completed {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-badge.closed {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(15, 23, 42, 0.6);
}

.data-table tr:hover td {
    background: rgba(6, 182, 212, 0.02);
}

.data-table .mono {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
}

.data-table .amount {
    color: var(--accent);
    font-weight: 600;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.8rem;
}

.tag.secondary {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
}

.tag-cloud a {
    padding: 0.375rem 0.875rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 20px;
    color: var(--accent);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s;
}

.tag-cloud a:hover {
    background: rgba(6, 182, 212, 0.2);
}

/* Alert Custom */
.alert-custom {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: var(--text);
    border-radius: 8px;
}

/* Modal Custom */
.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
}

.modal-header {
    border-bottom: 1px solid var(--border);
}

.modal-footer {
    border-top: 1px solid var(--border);
}

.btn-close {
    filter: invert(1);
}

/* Toast Custom */
.toast {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Dropdown Custom */
.dropdown-menu {
    background: var(--card);
    border: 1px solid var(--border);
}

.dropdown-item {
    color: var(--text);
}

.dropdown-item:hover {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}

.dropdown-divider {
    border-color: var(--border);
}

/* ============================================
   Footer
   ============================================ */
.gs-footer {
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
}

.gs-footer h4 {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.gs-footer a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.gs-footer a:hover {
    color: var(--accent);
}

.gs-footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .navbar-custom .nav-link::after {
        display: none;
    }
}
