html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.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 #258cfb;
}

/* Main Layout */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0c0c1e 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Container Styles */
.container, .container-fluid {
  padding-left: 15px;
  padding-right: 15px;
}

.main-content {
  min-height: calc(100vh - 140px);
  padding-bottom: 130px; /* Account for footer */
  padding-top: 20px; /* Normal spacing */
}

/* Space Theme Styles */
.space-theme {
    background: linear-gradient(135deg, #0c0c1e 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #e0e0e0;
}

.space-theme .container-fluid {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    padding: 20px;
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    color: #e0e0e0;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.card-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px 15px 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-header[data-bs-toggle="collapse"] {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.card-header[data-bs-toggle="collapse"]:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

.card-header[data-bs-toggle="collapse"] .fa-chevron-down,
.card-header[data-bs-toggle="collapse"] .fa-chevron-up {
    transition: transform 0.2s ease;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 15px 15px !important;
    padding: 0.75rem 1.25rem;
}

/* Grid and Layout Fixes */
.row {
  margin-left: -12px;
  margin-right: -12px;
}

.row > [class*="col-"] {
  padding-left: 12px;
  padding-right: 12px;
  margin-bottom: 20px;
}

/* Responsive Grid */
@media (max-width: 767.98px) {
    .col-md-6, .col-lg-4 {
        margin-bottom: 20px;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .resource-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 25px;
}

.btn-success {
    background: linear-gradient(45deg, #43e97b 0%, #38f9d7 100%);
    border: none;
    border-radius: 25px;
}

.btn-danger {
    background: linear-gradient(45deg, #fa709a 0%, #fee140 100%);
    border: none;
    border-radius: 25px;
}

/* Discord Button Styles */
.btn-discord {
    background-color: #5865F2 !important;
    border-color: #5865F2 !important;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-discord:hover {
    background-color: #4752C4 !important;
    border-color: #4752C4 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(88, 101, 242, 0.3);
}

.btn-discord:active,
.btn-discord:focus {
    background-color: #3C45A5 !important;
    border-color: #3C45A5 !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(88, 101, 242, 0.25);
}

.text-discord {
    color: #5865F2 !important;
}

/* Form Styles */
.form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #667eea;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control::placeholder {
    color: #b0b0b0;
}

.form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #667eea;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Table Styles */
.table {
    color: #e0e0e0;
    background: transparent;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.table thead th {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-dark {
    background: rgba(0, 0, 0, 0.3);
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

.table-responsive {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Pricing Table Styles */
.pricing-table {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.pricing-table .table {
    margin-bottom: 0;
}

.pricing-table .table th {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.pricing-table .table td {
    text-align: center;
    font-weight: 500;
}

.pricing-table .table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03);
}

.pricing-table .table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.08);
}

/* Badge Styles */
.badge {
    border-radius: 15px;
    padding: 8px 12px;
}

.badge.bg-warning {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(45deg, #43e97b 0%, #38f9d7 100%) !important;
}

/* Animation */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
    100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
}

.glow {
    animation: glow 2s infinite;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="white" opacity="0.8"/><circle cx="80" cy="40" r="1" fill="white" opacity="0.6"/><circle cx="60" cy="80" r="1" fill="white" opacity="0.7"/><circle cx="40" cy="60" r="1" fill="white" opacity="0.5"/></svg>');
    background-size: 200px 200px;
    padding: 100px 0;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 30px;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
    padding: 0;
}

.resource-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.resource-card .card-title {
    margin-bottom: 15px;
    color: #fff;
    font-weight: 600;
}

.resource-card .card-text {
    flex-grow: 1;
    margin-bottom: 20px;
}

.resource-card .pricing-info {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Multi-Resource Calculator Styles */
.resource-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease;
}

.resource-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.remove-resource-btn {
    border-radius: 8px;
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#orderItemsList .card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

#orderItemsList .card-body {
    padding: 0.75rem;
}

/* Navigation Spacing */
.navbar {
  margin-bottom: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 1050 !important;
  min-height: 70px;
  padding: 0.75rem 1rem;
  background: rgba(26, 26, 46, 0.95) !important;
  backdrop-filter: blur(10px);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  padding: 0.5rem 0;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.75rem 1rem;
}

/* Form Spacing */
.form-group {
    margin-bottom: 1.5rem;
}

.form-floating {
    margin-bottom: 1.5rem;
}

/* Button Spacing */
.btn {
    margin-bottom: 10px;
    margin-right: 10px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.btn:last-child {
    margin-right: 0;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Prevent overlay issues */
.card {
    position: relative;
    z-index: 1;
}

/* Prevent overlay and greying out issues */
.modal-backdrop {
    z-index: 1040;
}

.dropdown-menu {
    z-index: 1060;
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 160px;
}

.dropdown-menu.show {
    display: block;
}

/* Ensure forms and buttons are interactive */
.form-control:disabled,
.form-select:disabled {
    opacity: 0.6;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Fix for any potential backdrop issues */
body.modal-open {
    overflow: hidden;
}

/* Ensure admin pages don't have interaction issues */
.admin-content {
    position: relative;
    z-index: 1;
}

/* Section Spacing */
.section {
    padding: 40px 0;
}

.section + .section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navbar Adjustments */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #667eea !important;
}

/* Alert Styles */
.alert {
    border-radius: 15px;
    border: none;
}

.alert-success {
    background: linear-gradient(45deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(45deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.8) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: auto;
    padding: 20px 0;
}

/* Admin specific fixes */
.admin-content {
    margin-top: 20px !important;
    padding-top: 20px !important;
}

/* Modal fixes - Clean Bootstrap implementation */
.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1040;
}

.modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 3.5rem);
}

.modal-content {
    background: rgba(26, 26, 46, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: #e0e0e0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

.modal-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 15px 15px;
}

/* Responsive Utilities */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 991.98px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .nav-link span {
        display: inline !important;
    }
}

/* Positioning Fixes */
html {
  position: relative;
  min-height: 100%;
}

/* Remove conflicting body margin */

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Admin Dropdown Fixes */
.dropdown-menu {
    max-height: 300px !important;
    overflow-y: auto !important;
    border: 1px solid rgba(0,0,0,.15) !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    z-index: 1050 !important;
    position: absolute !important;
}

/* Ensure dropdowns don't get cut off in tables */
.table-responsive {
    overflow: visible !important;
}

/* Fix button group dropdown positioning */
.btn-group-vertical .dropdown-menu {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    margin-left: 0.125rem !important;
    min-width: 12rem !important;
}

/* Responsive dropdown fixes */
@media (max-width: 768px) {
    .btn-group-vertical .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        margin: 0 !important;
        transform: none !important;
    }
}

/* Inline editing styles */
.editable-field {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    position: relative;
}

.editable-field:hover {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

.editable-field.editing {
    background-color: rgba(13, 202, 240, 0.1) !important;
}

.editable-field.editing .form-control {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
    border: 1px solid #0dcaf0 !important;
}

.editable-field[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: -25px;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Table hover effects */
.table-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

.table-success {
    background-color: rgba(25, 135, 84, 0.15) !important;
}

/* Responsive table improvements */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

/* Calculator specific color fixes */
.calculator-pricing-cards .card.bg-light {
    background: rgba(108, 117, 125, 0.2) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.calculator-pricing-cards .card.bg-light .card-body {
    color: #e0e0e0 !important;
}

.calculator-pricing-cards .card.bg-light strong {
    color: #ffffff !important;
}

.calculator-pricing-cards .card.bg-light .text-muted {
    color: #d0d0d0 !important;
}

.calculator-pricing-cards .card.bg-info {
    background: linear-gradient(45deg, #0dcaf0 0%, #0d6efd 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.calculator-pricing-cards .card.bg-success {
    background: linear-gradient(45deg, #198754 0%, #20c997 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Order items list styling */
#orderItemsList .card {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #e0e0e0 !important;
}

#orderItemsList .card-body {
    padding: 0.75rem;
    color: #e0e0e0 !important;
}

#orderItemsList strong {
    color: #ffffff !important;
}

#orderItemsList .text-muted {
    color: #b0b0b0 !important;
}

#orderItemsList .text-end strong {
    color: #28a745 !important;
}

/* Badge color fixes */
.badge.bg-success {
    background: linear-gradient(45deg, #198754 0%, #20c997 100%) !important;
    color: #ffffff !important;
}

.badge.bg-secondary {
    background: linear-gradient(45deg, #6c757d 0%, #adb5bd 100%) !important;
    color: #ffffff !important;
}

/* Form label fixes */
.form-label {
    color: #e0e0e0 !important;
    font-weight: 500;
}

/* Ensure all text in cards is readable */
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
    color: #ffffff !important;
}

.card p, .card span, .card div {
    color: #e0e0e0 !important;
}

.card small.text-muted {
    color: #b0b0b0 !important;
}

/* Order form improvements */
#orderForm input[type="number"]:focus,
#orderForm select:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

/* Prevent form submission on Enter */
#orderForm input:not([type="submit"]):not([type="button"]) {
    outline: none;
}

/* Better spacing for order items */
.order-item {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 1rem !important;
}

.order-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Login Page Divider */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.divider span {
    background: var(--bs-card-bg, #fff);
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Login page card improvements */
.card.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.traditional-login {
    padding: 1rem 0;
}

/* Form floating label improvements for login */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #667eea !important;
    font-weight: 500;
}

.form-floating > label {
    color: #6c757d !important;
}

/* Button loading state */
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.65;
}

/* Responsive improvements for login */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem 1rem;
    }
    
    .btn-discord {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    .traditional-login h4 {
        font-size: 1.1rem;
    }
}

/* Discord Verification Styles */
.code-input {
    font-size: 2rem !important;
    letter-spacing: 0.5rem;
    font-weight: bold;
    text-align: center;
}

.verification-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

