/**
 * CnxCMS Default Theme CSS
 * Material Design Bootstrap 5+ - No jQuery
 * Styling driven by CSS custom properties injected by ThemeManager
 */

body {
    font-family: var(--theme-font-family-primary, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
    color: var(--theme-color-text, #333);
    font-size: var(--theme-font-size-base, 1rem);
    line-height: var(--theme-line-height-base, 1.6);
    background: #0b1a2e url('../images/boat-show-bg.jpg') no-repeat center center / cover fixed;
    min-height: 100vh;
}

h1 { font-size: var(--theme-h1-font-size, 2.5rem); font-weight: var(--theme-h1-font-weight, 700); color: var(--theme-h1-color, inherit); margin-bottom: var(--theme-h1-margin-bottom, 0.75rem); }
h2 { font-size: var(--theme-h2-font-size, 2rem);   font-weight: var(--theme-h2-font-weight, 600); color: var(--theme-h2-color, inherit); margin-bottom: var(--theme-h2-margin-bottom, 0.75rem); }
h3 { font-size: var(--theme-h3-font-size, 1.75rem);font-weight: var(--theme-h3-font-weight, 600); color: var(--theme-h3-color, inherit); margin-bottom: var(--theme-h3-margin-bottom, 0.5rem);  }
h4 { font-size: var(--theme-h4-font-size, 1.5rem); font-weight: var(--theme-h4-font-weight, 600); color: var(--theme-h4-color, inherit); margin-bottom: var(--theme-h4-margin-bottom, 0.5rem);  }
h5 { font-size: var(--theme-h5-font-size, 1.25rem);font-weight: var(--theme-h5-font-weight, 600); color: var(--theme-h5-color, inherit); margin-bottom: var(--theme-h5-margin-bottom, 0.5rem);  }
h6 { font-size: var(--theme-h6-font-size, 1rem);   font-weight: var(--theme-h6-font-weight, 600); color: var(--theme-h6-color, inherit); margin-bottom: var(--theme-h6-margin-bottom, 0.5rem);  }

a { color: var(--theme-link-color, #007bff); text-decoration: var(--theme-link-decoration, none); }
a:hover { color: var(--theme-link-hover-color, #0056b3); text-decoration: var(--theme-link-hover-decoration, underline); }

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
}

/* Content Wrapper */
.content-wrapper {
    animation: fadeIn 0.3s ease;
}

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

/* Cards */
.card {
    border: none;
    border-radius: var(--theme-border-radius, 12px);
    box-shadow: var(--theme-shadow-md, 0 2px 8px rgba(0, 0, 0, 0.08));
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--theme-shadow-lg, 0 8px 16px rgba(0, 0, 0, 0.12));
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--theme-color-primary, #007bff);
    color: var(--theme-color-primary-contrast, var(--theme-color-text-on-dark, #ffffff));
    border: none;
    border-radius: var(--theme-border-radius, 12px) var(--theme-border-radius, 12px) 0 0;
    font-weight: 600;
}

/* All text inside card-header inherits the header's contrast color */
.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6,
.card-header .card-title, .card-header a {
    color: inherit;
}

/* Light card-header variants: clear the background-image and use dark text */
.card-header.bg-white,
.card-header.bg-light,
.card-header.bg-transparent {
    background-image: none;
    color: var(--theme-color-text, #333);
}

.card-title {
    margin-bottom: 0;
    color: var(--theme-color-primary, #007bff);
}

/* Buttons */
.btn {
    border-radius: var(--theme-cta-border-radius, 8px);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--theme-cta-bg-color, #007bff);
    border-color:     var(--theme-cta-bg-color, #007bff);
    color:            var(--theme-cta-text-color, #fff);
}

.btn-primary:hover {
    background-color: var(--theme-cta-hover-bg-color, #0056b3);
    border-color:     var(--theme-cta-hover-bg-color, #0056b3);
    color:            var(--theme-cta-hover-text-color, #fff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-primary:active, .btn-primary.active {
    background-color: var(--theme-cta-active-bg-color, #004085);
    border-color:     var(--theme-cta-active-bg-color, #004085);
    color:            var(--theme-cta-active-text-color, #fff);
}

.btn-cta-passive {
    background-color: var(--theme-cta-passive-bg-color, transparent);
    color:            var(--theme-cta-passive-text-color, #007bff);
    border:     1px solid var(--theme-cta-passive-border-color, #007bff);
    border-radius:    var(--theme-cta-border-radius, 8px);
}

.btn-cta-passive:hover {
    background-color: var(--theme-cta-passive-hover-bg-color, #e8f0fe);
    color:            var(--theme-cta-passive-hover-text-color, #0056b3);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alert-info    { background-color: var(--theme-msg-info-bg,    #dbeafe); color: var(--theme-msg-info-text,    #1e40af); }
.alert-success { background-color: var(--theme-msg-success-bg, #dcfce7); color: var(--theme-msg-success-text, #166534); }
.alert-warning { background-color: var(--theme-msg-warning-bg, #fef3c7); color: var(--theme-msg-warning-text, #92400e); }
.alert-danger  { background-color: var(--theme-msg-error-bg,   #fee2e2); color: var(--theme-msg-error-text,   #991b1b); }

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--theme-color-border, #ddd);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--theme-color-secondary, #007bff);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--theme-color-text, #333);
    margin-bottom: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding-left: 0;
    margin-bottom: 2rem;
}

.breadcrumb-item a { color: var(--theme-link-color, #007bff); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* Tables */
.table { border-collapse: collapse; }

.table thead th {
    background-color: var(--theme-color-background, #f8f9fa);
    border-bottom: 2px solid var(--theme-color-border, #dee2e6);
    font-weight: 600;
    color: var(--theme-color-text, #333);
}

.table tbody tr:hover {
    background-color: var(--theme-color-background, #f8f9fa);
}

/* Footer */
footer {
    border-top: 1px solid var(--theme-color-border, #ddd);
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    main { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .card { margin-bottom: 1rem; }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.35rem; }

    footer { margin-top: 2rem; }

    .table-responsive { font-size: 0.9rem; }

    img { max-width: 100%; height: auto; }
}

@media (max-width: 576px) {
    main { padding-top: 1rem !important; padding-bottom: 1rem !important; }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    h4 { font-size: 1rem; }

    .container { padding-left: 1rem; padding-right: 1rem; }

    .btn { font-size: 0.9rem; }

    .breadcrumb { font-size: 0.85rem; }

    .table-responsive { font-size: 0.8rem; }

    .navbar-brand { font-size: 1rem; }
}
