/* PixSF - Custom Styles */

:root {
    --primary: #0d6efd;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --pixsf-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --pixsf-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --pixsf-gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --pixsf-gradient-warning: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
    --pixsf-gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --pixsf-gradient-info: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    --pixsf-gradient-dark: linear-gradient(135deg, #434343 0%, #000000 100%);
}

body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pixsf-navbar {
    background: linear-gradient(90deg, #18222f 0%, #1f2e40 40%, #233a4d 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.pixsf-navbar .navbar-brand {
    color: #f5f9ff;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.pixsf-navbar .brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #3df58f);
    box-shadow: 0 0 10px rgba(61, 245, 143, 0.55);
}

.navbar-links .nav-link {
    color: rgba(241, 247, 255, 0.82);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    margin-right: 0.2rem;
    transition: all .2s ease;
}

.navbar-links .nav-link.active,
.navbar-links .nav-link:hover {
    color: #fff;
    background: rgba(54, 132, 255, 0.24);
}

.session-pill {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e8f6ff;
    background: rgba(32, 180, 255, 0.2);
    border: 1px solid rgba(141, 226, 255, 0.3);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    min-width: 76px;
    text-align: center;
}

.session-pill.session-warning {
    background: rgba(255, 193, 7, 0.25);
    border-color: rgba(255, 193, 7, 0.45);
    color: #fff3cd;
}

.session-pill.session-danger {
    background: rgba(220, 53, 69, 0.25);
    border-color: rgba(220, 53, 69, 0.5);
    color: #ffd2d8;
}

/* Navbar fixed top compensation */
.main-content {
    padding-top: 76px;
    min-height: calc(100vh - 60px);
    padding-bottom: 20px;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 50%, #084298 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 1rem;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Cards */
.card {
    border-radius: 0.75rem;
    border: none;
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* Dashboard Stat Cards */
.stat-card {
    border: none;
    border-radius: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.2;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 600;
}

/* Gradient Cards */
.bg-gradient-primary { background: var(--pixsf-gradient) !important; }
.bg-gradient-success { background: var(--pixsf-gradient-success) !important; }
.bg-gradient-warning { background: var(--pixsf-gradient-warning) !important; }
.bg-gradient-danger { background: var(--pixsf-gradient-danger) !important; }
.bg-gradient-info { background: var(--pixsf-gradient-info) !important; }
.bg-gradient-dark { background: var(--pixsf-gradient-dark) !important; }

/* Quick Action Cards */
.quick-action {
    border-radius: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    overflow: hidden;
}

.quick-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    color: inherit;
}

.quick-action .action-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

/* Welcome Banner */
.welcome-banner {
    background: var(--pixsf-gradient);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner > * {
    position: relative;
    z-index: 1;
}

/* Mode Toggle */
.mode-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 4px;
    display: inline-flex;
    position: relative;
    z-index: 2;
}

.mode-toggle .btn {
    border-radius: 2rem;
    padding: 6px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    transition: all 0.3s ease;
}

.mode-toggle .btn.active-mode {
    background: white;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mode-toggle .btn:not(.active-mode) {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
}

.mode-toggle .btn:not(.active-mode):hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badges */
.badge {
    font-weight: 500;
}

/* QR Code display */
.qrcode-container {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.qrcode-container img {
    max-width: 280px;
    height: auto;
}

/* Pix value display */
.pix-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #198754;
}

/* Copy button */
.btn-copy {
    position: relative;
}

/* Footer */
.pixsf-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: rgba(255, 255, 255, 0.7);
    padding: 14px 0;
    font-size: 0.8rem;
    margin-top: auto;
}

.pixsf-footer .footer-brand {
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.pixsf-footer .footer-sep {
    color: rgba(255, 255, 255, 0.3);
}

.pixsf-footer .footer-info {
    color: rgba(255, 255, 255, 0.6);
}

.pixsf-footer .footer-dev {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pixsf-footer .footer-dev-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.85;
    transition: opacity 0.3s;
}

.pixsf-footer .footer-dev-logo:hover {
    opacity: 1;
}

/* Collapsible sections */
.collapse-trigger {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.collapse-trigger:hover {
    color: var(--primary);
}

.collapse-trigger .bi-chevron-down {
    transition: transform 0.3s;
}

.collapse-trigger[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* User/Store cards */
.entity-card {
    border: none;
    border-radius: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.entity-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.entity-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

/* Form section */
.form-section {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Link detail info cards */
.info-block {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 1rem;
    padding: 1.5rem;
}

.info-block-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    .welcome-banner {
        padding: 1rem 1.25rem;
    }
    .pixsf-footer {
        text-align: center;
    }
    .pixsf-footer .footer-dev-logo {
        height: 22px;
    }
}

.btn-copy.copied::after {
    content: 'Copiado!';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    animation: fadeOut 1.5s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Generate Pix button */
.btn-generate-pix {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    transition: all 0.3s;
}

.btn-generate-pix:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

/* Pulse animation for pending status */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Flash messages */
.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* Sidebar active */
.nav-link.active {
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 0.5rem;
}

/* Dashboard quick actions */
.quick-action {
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content {
        padding-top: 66px;
    }

    .pix-value {
        font-size: 1.8rem;
    }

    .btn-generate-pix {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Input mask styling */
.input-valor {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 1px;
}

/* Session timeout modal */
#sessionTimeoutModal .modal-content {
    border: none;
    border-radius: 1rem;
}

/* Delete zone */
.delete-zone {
    border: 2px dashed #dc3545;
    border-radius: 0.75rem;
    padding: 1.5rem;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Loading spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Print styles */
@media print {
    .navbar, .btn, .card-footer, form, .alert {
        display: none !important;
    }
    .main-content {
        padding-top: 0;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}
