/* Dark Theme CSS for Titan Reseller Panel */

:root {
    --bg-dark: #0a0a0a;
    --bg-darker: #1a1a1a;
    --bg-card: #2a2a2a;
    --text-light: #e0e0e0;
    --text-muted: #888888;
    --danger-red: #dc3545;
    --danger-red-hover: #bb2d3b;
    --success-green: #198754;
    --warning-yellow: #ffc107;
    --info-blue: #0dcaf0;
    --border-color: #3a3a3a;
}

/* Notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

body {
    background-color: var(--bg-dark) !important;
    color: var(--text-light) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sticky layout to keep footer at the bottom without extra space */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container-xxl {
    flex: 1 0 auto;
}

.site-footer {
    margin-top: auto;
}

/* Form labels and text */
.form-label {
    color: var(--text-light) !important;
}

.form-text {
    color: var(--text-light) !important;
}

label {
    color: var(--text-light) !important;
}

/* General text visibility */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-light) !important;
}

p {
    color: var(--text-light) !important;
}

.text-muted {
    color: #aaa !important;
}

/* Custom darker background */
.bg-darker {
    background-color: var(--bg-darker) !important;
}

.bg-card {
    background-color: var(--bg-card) !important;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    color: var(--text-light);
}

.card .card-title {
    color: var(--text-light) !important;
}

.card .card-text {
    color: var(--text-light) !important;
}

.card-header {
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
}

/* Buttons */
.btn-danger {
    background-color: var(--danger-red);
    border-color: var(--danger-red);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: var(--danger-red-hover);
    border-color: var(--danger-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-outline-danger {
    color: var(--danger-red);
    border-color: var(--danger-red);
}

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

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* Forms */
.form-control {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-light) !important;
}

.form-control:focus {
    background-color: var(--bg-card) !important;
    border-color: var(--danger-red) !important;
    color: var(--text-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-control::placeholder {
    color: #888 !important;
}

.form-select {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-light) !important;
}

.form-select:focus {
    background-color: var(--bg-card) !important;
    border-color: var(--danger-red) !important;
    color: var(--text-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-select option {
    background-color: var(--bg-card) !important;
    color: var(--text-light) !important;
}

/* Form validation feedback */
.invalid-feedback {
    color: var(--danger-red) !important;
}

.valid-feedback {
    color: var(--success-green) !important;
}

/* Small text and help text */
small {
    color: var(--text-light) !important;
}

.small {
    color: var(--text-light) !important;
}

/* Strong and bold text */
strong {
    color: var(--text-light) !important;
}

/* Input group styling */
.input-group-text {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-light) !important;
}

/* Tables */
.table-dark {
    --bs-table-bg: var(--bg-card);
    --bs-table-border-color: var(--border-color);
}

.table-dark th {
    background-color: var(--bg-darker);
    border-color: var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-darker) 100%);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--text-light) !important;
}

.stats-card * {
    color: var(--text-light) !important;
}

.stats-card .text-muted {
    color: #ccc !important;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--danger-red), var(--warning-yellow), var(--success-green));
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Navbar customization */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-link:hover {
    color: var(--danger-red) !important;
    transition: color 0.3s ease;
}

/* Dropdown */
.dropdown-menu-dark {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
}

.dropdown-item:hover {
    background-color: var(--danger-red);
}

/* Tabs styling to match dark + red theme */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
}

/* Override Bootstrap's nav-tabs active styling */
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    border-bottom: none !important;
    border-bottom-color: transparent !important;
}

.nav-tabs .nav-item {
    white-space: nowrap;
}

.nav-tabs .nav-link {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    margin-right: .25rem;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.nav-tabs .nav-link:hover {
    color: var(--danger-red) !important;
    border-color: var(--danger-red);
}

.nav-tabs .nav-link.active {
    color: #fff !important;
    background-color: var(--bg-card);
    border-color: var(--danger-red) var(--danger-red) transparent !important;
    border-bottom: none !important;
    position: relative;
    box-shadow: 0 0.1px 0 0 var(--danger-red) !important;
}

/* Removed ::after pseudo-element - using box-shadow instead */

/* Mobile tab improvements */
@media (max-width: 768px) {
    .nav-tabs {
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 1rem;
    }
    
    .nav-tabs .nav-link {
        font-size: 0.85rem;
        font-weight: bold;
        padding: 0.4rem 0.75rem;
        margin-right: 0.1rem;
    }
    
    .nav-tabs .nav-link i {
        display: none;
    }
    
    /* Make the red underline even thinner on mobile */
    .nav-tabs .nav-link.active {
        box-shadow: 0 0.05px 0 0 var(--danger-red) !important;
    }
}

@media (max-width: 576px) {
    .nav-tabs .nav-link {
        font-size: 0.81rem;
        font-weight: bold;
        padding: 0.4rem 0.6rem;
    }
}

/* Loading spinner */
.spinner-border {
    color: var(--danger-red);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--danger-red);
    border-radius: 10px;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Simple, clean table styling like Recent Generations */

/* Badge font size utility */
.fs-7 { 
    font-size: 0.75rem !important;
}

/* Keep the existing stackable table styling that already works well */

/* Utility spacing and radius helpers */
.rounded-12 { border-radius: 12px !important; }
.rounded-16 { border-radius: 16px !important; }
.shadow-soft { box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .stats-card {
        text-align: center;
        padding: 1rem;
    }
    
    .stats-icon {
        font-size: 2rem;
    }
    
    /* Very small screen button optimizations */
    .btn-group .btn,
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }
    
    /* Improve mobile card spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Mobile search improvements */
    .input-group {
        flex-wrap: nowrap;
    }
    
    .input-group .form-control {
        min-width: 0;
        flex: 1;
    }
}

/* Alert customization */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #f8d7da;
    border-left: 4px solid var(--danger-red);
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #d1e7dd;
    border-left: 4px solid var(--success-green);
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: #b6effb;
    border-left: 4px solid var(--info-blue);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #fff3cd;
    border-left: 4px solid var(--warning-yellow);
}

/* Key generation form */
.generate-form {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-darker) 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pricing-option {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pricing-option:hover {
    border-color: var(--danger-red);
    transform: scale(1.02);
}

.pricing-option.selected {
    border-color: var(--danger-red);
    background-color: rgba(220, 53, 69, 0.1);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Badge customization */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

/* Titan Logo Styling */
.titan-logo {
    height: 40px;
    width: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(220, 53, 69, 0.3));
}

.titan-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(220, 53, 69, 0.5));
}

.titan-login-logo {
    height: 80px;
    width: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(220, 53, 69, 0.4));
    animation: logoGlow 3s ease-in-out infinite alternate;
}

.titan-login-logo:hover {
    transform: scale(1.1) rotate(2deg);
    filter: drop-shadow(0 6px 12px rgba(220, 53, 69, 0.6));
}

.logo-container {
    position: relative;
    display: inline-block;
}

.logo-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 53, 69, 0.1), transparent);
    z-index: -1;
    animation: logoHalo 4s ease-in-out infinite;
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 4px 8px rgba(220, 53, 69, 0.4));
    }
    100% {
        filter: drop-shadow(0 6px 15px rgba(220, 53, 69, 0.7)) drop-shadow(0 0 20px rgba(220, 53, 69, 0.3));
    }
}

@keyframes logoHalo {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Brand text styling */
.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #dc3545, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Mobile responsiveness for logos */
@media (max-width: 768px) {
    .titan-logo {
        height: 35px;
    }
    
    .titan-login-logo {
        height: 60px;
    }
    
    .brand-text {
        font-size: 1.1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .titan-logo {
        height: 30px;
    }
    
    .titan-login-logo {
        height: 50px;
    }
    
    .brand-text {
        font-size: 0.9rem;
        /* Keep text visible on mobile, just smaller */
    }
    
    .navbar-brand {
        flex-direction: row !important;
        align-items: center !important;
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .titan-hero-logo {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .brand-text {
        font-size: 0.8rem;
    }
    
    .navbar-brand {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .brand-text {
        display: none; /* Only hide on very tiny screens */
    }
}

/* Hero logo styling */
.titan-hero-logo {
    height: 120px;
    width: auto;
    transition: all 0.4s ease;
    filter: drop-shadow(0 8px 16px rgba(220, 53, 69, 0.4));
    animation: heroLogoFloat 5s ease-in-out infinite;
}

.titan-hero-logo:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 12px 24px rgba(220, 53, 69, 0.6)) drop-shadow(0 0 30px rgba(220, 53, 69, 0.4));
}

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

/* Additional hero logo mobile styles */
@media (max-width: 768px) {
    .titan-hero-logo {
        height: 90px;
    }
}

@media (max-width: 576px) {
    .titan-hero-logo {
        height: 70px;
    }
}

/* Modal customization */
.modal {
    z-index: 1055 !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal-backdrop {
    z-index: 1050 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    position: relative;
    pointer-events: auto;
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
}

/* Smooth modal appearance without glitches */
.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
    transform: translate(0, -25px);
}

.modal.show .modal-dialog {
    transform: translate(0, 0) !important;
}

.modal.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.modal.show {
    opacity: 1;
}

/* Ensure modal scrolling */
.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
    max-height: calc(100vh - 210px);
    overflow-y: auto;
}

/* Fix modal centering */
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

/* Prevent body scroll when modal open */
body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

/* Disable all page animations when modal is open */
body.modal-open .card,
body.modal-open .stats-card,
body.modal-open .btn:not(.modal *) {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.loading-overlay.show {
    display: flex;
}

/* History table styling */
.history-table {
    background-color: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Status badges */
.status-active {
    background-color: var(--success-green);
}

.status-inactive {
    background-color: var(--text-muted);
}

.status-expired {
    background-color: var(--danger-red);
}

/* Input group styling */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: none;
}

/* Custom switches */
.form-check-input:checked {
    background-color: var(--danger-red);
    border-color: var(--danger-red);
}

.form-check-input:focus {
    border-color: var(--danger-red);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
