/* ==========================================================================
   Megazord App - Global Styles
   Based on Login Page Design System
   ========================================================================== */

:root {
    --primary-gradient-start: #667eea;
    --primary-gradient-end: #764ba2;
    --primary-color: #4e73df;
    --primary-hover: #2e59d9;
    --text-primary: #333;
    --text-secondary: #6c757d;
    --bg-light: #f4f6f9;
    --card-radius: 15px;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

/* Base Styles */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Page Container */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar-custom {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border: none;
    padding: 0.75rem 0;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary-color) !important;
}

.navbar-custom .nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
    margin: 0 0.25rem;
}

.navbar-custom .nav-link:hover {
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--primary-color) !important;
}

.navbar-custom .nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
}

/* Main Content Area */
.content-container {
    flex: 1;
    padding: 2rem 1.5rem;
}

/* Cards */
.card-custom {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background-color: white;
    overflow: hidden;
}

.card-custom .card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.card-custom .card-header h3,
.card-custom .card-header h4,
.card-custom .card-header h5 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0;
}

.card-custom .card-body {
    padding: 1.5rem;
}

/* Page Header */
.page-header {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.page-header h1,
.page-header h2 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: all var(--transition-speed) ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: #2653d4;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

.btn-outline-danger {
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

.btn-outline-danger:hover {
    transform: translateY(-1px);
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
}

.form-floating > label {
    color: var(--text-secondary);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
}

/* Select2 (client dropdown) - match form-control styling */
.client-select2 + .select2-container .select2-selection--single {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    min-height: calc(1.5em + 1.2rem + 2px);
    height: auto;
    transition: all var(--transition-speed) ease;
}

.client-select2 + .select2-container .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    line-height: 1.5;
}

.client-select2 + .select2-container.select2-container--focus .select2-selection--single,
.client-select2 + .select2-container.select2-container--open .select2-selection--single {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
    outline: 0;
}

.client-select2 + .select2-container .select2-selection__arrow {
    height: 100%;
    right: 0.75rem;
}

.select2-dropdown {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: var(--card-shadow);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
}

.select2-search--dropdown .select2-search__field {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.4rem 0.75rem;
}

/* Tables */
.table-custom {
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background: white;
}

.table-custom .table {
    margin-bottom: 0;
}

.table-custom .table thead {
    background: #4c51bf;
    background-color: #4c51bf;
}

.table-custom .table thead th {
    color: #fff !important;
    font-weight: 600;
    border: none;
    padding: 1rem;
    background: transparent;
}

.table-custom .table thead th a {
    color: #fff !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.table-custom .table thead th a:hover {
    color: #e2e8f0 !important;
}

.table-custom .table tbody tr {
    transition: all var(--transition-speed) ease;
}

.table-custom .table tbody tr:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

.table-custom .table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
    border-radius: 6px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 0.25rem;
    border: none;
    color: var(--primary-color);
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
}

.pagination .page-link:hover {
    background-color: rgba(78, 115, 223, 0.1);
    transform: translateY(-1px);
}

/* Outbound loading overlay – cobre apenas a área da tabela */
#outboundTableSection .outbound-loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
    align-items: center;
    justify-content: center;
}

#outboundTableSection.outbound-loading .outbound-loading-overlay {
    display: flex;
}

.outbound-loading-spinner {
    text-align: center;
}

/* Footer */
.footer-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    margin-top: auto;
}

.footer-custom a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.footer-custom a:hover {
    color: var(--primary-hover);
}

/* Dashboard Stats Cards */
.stat-card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background: white;
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-speed) ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Welcome/Hero Section */
.hero-section {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 3rem;
    text-align: center;
}

.hero-section h1 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hero-section .btn {
    margin-top: 1rem;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        padding: 1rem 1.5rem;
    }
    
    .hero-section {
        padding: 2rem 1.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* Focus states */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(78, 115, 223, 0.5);
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-speed) ease;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-color);
}
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 40px !important;
}

