/**
 * Specs5 - "Tech Noir" Theme (style-1.css)
 * A custom, brandable stylesheet that overrides Bootstrap defaults.
 *
 * @version 1.0
 */

/* ==========================================================================
   1. Google Fonts & Root Variables (Brand Configuration)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Roboto:wght@400;500;700&display=swap');

:root {
    /* Brand Colors - "Tech Noir" Palette */
    --primary-color: #9333ea;  /* Cyber Purple */
    --primary-color-light: #a855f7;
    --accent-color: #4ade80;   /* Pulse Green */
    --accent-color-dark: #22c55e;

    /* Background & Surfaces */
    --body-bg: #111827;        /* Deep Off-Black */
    --surface-bg: rgba(31, 41, 55, 0.7); /* Semi-transparent "Glass" */
    --surface-border: rgba(107, 114, 128, 0.4);
    --surface-hover-bg: rgba(55, 65, 81, 0.7);

    /* Typography */
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --text-primary: #f9fafb;     /* Bright White */
    --text-secondary: #d1d5db; /* Light Grey */
    --text-muted: #9ca3af;     /* Muted Grey */
}

/* ==========================================================================
   2. Bootstrap Overrides & Global Styles
   ========================================================================== */

body {
    background-color: var(--body-bg);
    color: var(--text-secondary);
    font-family: var(--font-body);
}

/* Override default link colors */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--accent-color-dark);
}

/* Override default text colors */
.text-dark { color: var(--text-primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--accent-color) !important; }

/* Override background colors */
.bg-light {
    background-color: transparent !important; /* Make bg-light transparent to support glassmorphism */
}
.bg-dark {
    background-color: var(--body-bg) !important;
}

/* Override borders */
.border, .border-bottom, .border-top, .border-start, .border-end {
    border-color: var(--surface-border) !important;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    text-shadow: 0 0 5px rgba(147, 51, 234, 0.3); /* Subtle purple glow */
}

.section-title::after {
    background-color: var(--primary-color);
}

/* ==========================================================================
   4. Header & Navigation
   ========================================================================== */

.site-header {
    background-color: rgba(17, 24, 39, 0.8) !important; /* Slightly transparent header */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--surface-border);
}

.offcanvas, .modal-content {
    background-color: var(--body-bg);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
}

.offcanvas-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%); /* Make close button white */
}

.main-menu a:hover {
    color: var(--primary-color) !important;
}

/* ==========================================================================
   5. Glassmorphism UI (Cards, Modals)
   ========================================================================== */

.card, .list-group-item, .sidebar-widget, .alert {
    background-color: var(--surface-bg);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(12px);
    color: var(--text-secondary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card:hover, .list-group-item-action:hover {
    background-color: var(--surface-hover-bg);
    border-color: rgba(147, 51, 234, 0.5);
}

.card-header, .modal-header {
    background-color: rgba(55, 65, 81, 0.5);
    border-bottom-color: var(--surface-border) !important;
}

.card-title {
    color: var(--text-primary);
}

.phone-card {
    box-shadow: none;
}
.phone-card:hover {
    transform: translateY(-5px);
}

/* ==========================================================================
   6. Buttons & Forms
   ========================================================================== */

.btn {
    font-weight: 700;
    transition: all 0.2s ease;
}

/* Custom Primary Button */
.btn-primary {
    background-image: linear-gradient(to right, var(--primary-color), var(--primary-color-light));
    border: none;
    color: var(--text-primary);
}
.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.5);
    color: var(--text-primary);
}

/* Custom Secondary/Dark Button */
.btn-dark, .btn-secondary {
    background-color: var(--surface-bg);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
}
.btn-dark:hover, .btn-secondary:hover {
    background-color: var(--surface-hover-bg);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Forms */
.form-control, .form-select {
    background-color: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    background-color: var(--body-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
    color: var(--text-primary);
}
.form-control::placeholder {
    color: var(--text-muted);
}
.input-group-text {
    background-color: var(--surface-bg);
    border: 1px solid var(--surface-border);
    color: var(--primary-color);
}

/* ==========================================================================
   7. Page-Specific Styles
   ========================================================================== */

/* Breadcrumbs */
.breadcrumb-item a {
    color: var(--text-muted);
}
.breadcrumb-item a:hover {
    color: var(--text-primary);
}
.breadcrumb-item.active {
    color: var(--text-primary);
}

/* Badges */
.badge.bg-success {
    background-color: var(--accent-color) !important;
    color: var(--body-bg);
}
.badge.bg-secondary {
    background-color: var(--surface-hover-bg) !important;
    color: var(--text-secondary);
}
.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Star Rating */
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--primary-color);
}
.stars-inner::before {
    color: var(--primary-color); /* Gold stars in rating summary */
}

/* Favorite Button */
#addToFavorites.favorited {
    background-image: none;
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
#addToFavorites.favorited:hover {
    background-color: var(--primary-color-light);
    border-color: var(--primary-color-light);
}

/* ==========================================================================
   8. Star Rating Systems (Corrected)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Interactive Star Rating (for the 'Add Review' modal)
   -------------------------------------------------------------------------- */
.star-rating {
    display: flex;
    flex-direction: row-reverse; /* This makes the hover effect work correctly */
    justify-content: flex-end;   /* Aligns stars to the left */
    font-size: 1.8em;
    color: var(--surface-border); /* Default color for empty stars */
    position: relative;
    padding: 0;
    margin: 0;
}

.star-rating input {
    display: none; /* The actual radio buttons are hidden */
}

.star-rating label {
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0 0.1em;
}

/* This is the magic part for the hover and checked state */
.star-rating input:checked ~ label, /* All labels AFTER a checked input */
.star-rating label:hover,          /* The label being hovered on */
.star-rating label:hover ~ label {  /* All labels AFTER the hovered label */
    color: var(--primary-color);   /* Use the "Cyber Purple" brand color */
}


/* --------------------------------------------------------------------------
   Static Star Rating Display (for the sidebar 'User Ratings' widget)
   -------------------------------------------------------------------------- */
.stars-outer {
    position: relative;
    display: inline-block;
    font-family: "Font Awesome 5 Free"; /* Use Font Awesome for the stars */
    font-weight: 400; /* Use the 'regular' (empty outline) star style */
    font-size: 1.1em;
    color: var(--surface-border); /* Color for the background empty stars */
}

/* We use a pseudo-element to draw the 5 empty background stars */
.stars-outer::before {
    content: "\f005 \f005 \f005 \f005 \f005";
}

.stars-inner {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    width: 0; /* This width is set dynamically with inline styles in PHP */
    font-family: "Font Awesome 5 Free";
    font-weight: 900; /* Use the 'solid' star style */
}

/* We use another pseudo-element to draw the 5 solid foreground stars */
.stars-inner::before {
    content: "\f005 \f005 \f005 \f005 \f005";
    color: var(--primary-color); /* Use the "Cyber Purple" brand color */
}

/* --- Home Page --- */
.comparison-item {
    transition: background-color 0.2s ease;
}
.comparison-item .comparison-images {
    position: relative;
    width: 60px;
    height: 40px;
}
.comparison-item .comparison-img {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--card-bg);
    border-radius: 50%;
    object-fit: contain;
}
.comparison-item .comparison-img:first-child {
    left: 0;
    z-index: 1;
}
.comparison-item .comparison-img:last-child {
    right: 0;
}


/* ==========================================================================
   9. Brand Statistics Card (NEW)
   ========================================================================== */

.brand-stat-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.brand-stat-card .brand-logo {
    filter: invert(1) grayscale(100%) brightness(200%); /* Make logos white for dark theme */
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.brand-stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.brand-stat-card:hover .brand-logo {
    opacity: 1;
}

.brand-stat-card .stat-item .stat-value {
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 700;
}

.brand-stat-card .stat-item .stat-label {
    color: var(--text-muted);
}