:root {
    --primary-color: #003366; /* Deep Blue for Trust and Strength */
    --secondary-color: #B8860B; /* Muted Gold for Maturity */
    --accent-color: #0056b3; /* Slightly lighter blue for accents */
    --text-color: #333333;
    --background-color: #f8f9fa;
    --light-gray: #cccccc;
    --dark-gray: #666666;
}

body {
    font-family: 'Roboto', sans-serif; /* A clean, readable sans-serif font */
    color: var(--text-color);
    background-color: #f8f9fa; /* Fallback color */
    background-image: url('/static/bg/background-image.png');
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif; /* Stronger font for headings */
    color: var(--primary-color);
}

/* General Link Styling */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Override Bootstrap primary color */
.btn-primary, .bg-primary, .text-primary {
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 0, 51, 102;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    transition: all 0.2s ease-in-out; /* Added transition */
}

.btn-outline-primary {
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 0, 51, 102;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transition: all 0.2s ease-in-out; /* Added transition */
}

.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.text-success {
    color: var(--secondary-color) !important; /* Using secondary for success/icons */
}

.btn-outline-success {
    color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    transition: all 0.2s ease-in-out; /* Added transition */
}

.btn-outline-success:hover {
    background-color: var(--secondary-color) !important;
    color: white !important;
}

.navbar {
    background-color: var(--primary-color) !important;
}

.navbar .nav-link, .navbar .navbar-brand {
    color: white !important;
}

.navbar .nav-link:hover {
    color: var(--light-gray) !important;
}

.navbar-logo {
  height: 100px;
  width: auto;
  transition: max-height 0.2s ease-in-out;
}

.dropdown-menu {
    background-color: var(--primary-color);
}

.dropdown-item {
    color: white;
}

.dropdown-item:hover {
    background-color: var(--accent-color);
    color: white;
}

.card {
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white to blend with background image */
    border-color: var(--light-gray);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Added transition */
}

.card:hover {
    transform: translateY(-5px); /* Subtle lift on hover */
    box-shadow: 0 8px 16px rgba(0,0,0,0.1); /* Enhanced shadow on hover */
}

.card-header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--light-gray);
    color: var(--primary-color);
}

.carousel-caption {
    background-color: rgba(0, 51, 102, 0.3) !important; /* Light semi-transparent primary color */
    border-radius: 5px;
}

/* Credit Card Mockup Styling */
.credit-card-mockup {
    width: 320px; /* Standard card width */
    height: 200px; /* Standard card height (approx 1.6:1 aspect ratio) */
    background: linear-gradient(45deg, var(--primary-color), #336699); /* Gradient background */
    border-radius: 15px;
    color: white;
    padding: 20px;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px; /* Space below the card mockup */
}

.card-chip {
    width: 40px;
    height: 30px;
    background-color: #b0b0b0;
    border-radius: 5px;
    position: absolute;
    top: 25px;
    left: 25px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.card-network-logo {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-number {
    font-family: 'Space Mono', monospace;
    font-size: 1.5em;
    letter-spacing: 3px;
    position: absolute;
    top: 90px;
    left: 25px;
    right: 25px;
    text-align: center;
}

.card-holder-name {
    font-size: 1em;
    text-transform: uppercase;
    position: absolute;
    bottom: 45px;
    left: 25px;
}

.card-expiry {
    font-size: 0.9em;
    position: absolute;
    bottom: 25px;
    left: 25px;
}

/* Form Control Styling */
.form-control {
    border-color: var(--light-gray);
    box-shadow: none;
    transition: border-color 0.2s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 51, 102, 0.25); /* Primary color focus ring */
}

/* Footer Styling */
footer {
    background-color: #002244 !important; /* Darker shade of primary blue */
    color: white !important;
}

footer a {
    color: var(--light-gray) !important;
}

footer a:hover {
    color: white !important;
}

footer h5 {
    color: white !important; /* Ensure footer headers are white */
}

/* General Section Spacing */
.container.mt-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* Badge Styling */
.badge {
    padding: 0.5em 0.75em;
    border-radius: 0.3rem;
    font-weight: 600;
}

.badge.bg-success {
    background-color: var(--secondary-color) !important; /* Muted gold for success */
    color: white !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important; /* Standard warning yellow */
    color: #333 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important; /* Standard danger red */
    color: white !important;
}

.badge.bg-secondary {
    background-color: var(--dark-gray) !important; /* Dark gray for secondary */
    color: white !important;
}

/* Table Styling */
.table thead th {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-bottom: 2px solid var(--accent-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 51, 102, 0.05); /* Very light primary tint */
}

.table tbody tr:hover {
    background-color: rgba(0, 51, 102, 0.1); /* Slightly darker tint on hover */
    cursor: pointer;
}

/* Pagination Styling */
.pagination .page-item .page-link {
    color: var(--primary-color);
    border-color: var(--light-gray);
    transition: all 0.2s ease-in-out;
}

.pagination .page-item .page-link:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Top Bar Styling */
.top-bar-nav {
    display: flex;
    align-items: center;
}

.top-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e7e7e7;
}

.top-bar .list-inline-item a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

.top-bar .list-inline-item a:hover {
    color: #007bff;
}

.carousel-item .carousel-image {
  object-fit: cover;
  height: 600px; /* Default height for desktop */
}

@media (max-width: 992px) { /* Corresponds to navbar-expand-lg breakpoint */
  .navbar-logo {
    max-height: 70px;
  }
}

@media (max-width: 767px) { /* Below the md breakpoint */
  .top-bar .col-md-6 {
    justify-content: center !important; /* Center the UL itself */
    text-align: center;
    margin-bottom: 0.5rem; /* Add some space between the two rows */
  }
  .top-bar-nav {
    flex-wrap: wrap;
    justify-content: center; /* Center the links within the UL */
  }
}

@media (max-width: 768px) {
  .carousel-item .carousel-image {
    height: auto; /* Let the image height adjust to maintain aspect ratio */
  }

  .carousel-caption {
    position: static;
    background-color: var(--background-color) !important; /* Use a light background */
    padding: 20px;
    border-radius: 0 !important; /* Remove border-radius */
    text-align: left; /* Or center, depending on design preference */
  }

  .carousel-caption h1,
  .carousel-caption p {
    color: var(--primary-color) !important; /* Change text to a dark color */
    text-shadow: none !important; /* Remove text shadow */
  }
}
