/* PowerCommons - European Digital Sovereignty Theme */
/* Clean, bright theme inspired by EU visual identity */

:root {
    /* EU-inspired color palette */
    --pc-eu-blue: #003399;
    --pc-eu-gold: #FFCC00;
    --pc-light-blue: #004494;
    --pc-bright-blue: #0066CC;
    --pc-sovereignty-green: #2E7D32;
    --pc-success-green: #4CAF50;
    --pc-warning-orange: #FF6F00;
    --pc-light-gray: #F5F5F5;
    --pc-medium-gray: #E0E0E0;
    --pc-dark-gray: #424242;
    
    /* Override mdbook defaults for light theme */
    --bg: #FFFFFF;
    --fg: #212121;
    --sidebar-bg: #FAFAFA;
    --sidebar-fg: #003399;
    --sidebar-non-existant: #9E9E9E;
    --sidebar-active: var(--pc-eu-blue);
    --sidebar-spacer: #E0E0E0;
    --scrollbar: #BDBDBD;
    --icons: var(--pc-eu-blue);
    --icons-hover: var(--pc-eu-gold);
    --links: var(--pc-bright-blue);
    --inline-code-color: #B71C1C;
    --theme-popup-bg: #FFFFFF;
    --theme-popup-border: var(--pc-medium-gray);
    --theme-hover: rgba(0, 51, 153, 0.05);
    --quote-bg: #F8F9FA;
    --quote-border: var(--pc-eu-gold);
    --table-border-color: var(--pc-medium-gray);
    --table-header-bg: var(--pc-light-gray);
    --table-alternate-bg: #FAFAFA;
    --searchbar-border-color: var(--pc-eu-blue);
    --searchbar-bg: #FFFFFF;
    --searchbar-fg: #424242;
    --searchbar-shadow-color: rgba(0, 51, 153, 0.1);
    --searchresults-header-fg: var(--pc-eu-blue);
    --searchresults-border-color: var(--pc-medium-gray);
    --searchresults-li-bg: #FFFFFF;
    --search-mark-bg: var(--pc-eu-gold);
}

/* Force light background even in dark mode for readability */
.navy, .coal, .ayu {
    --bg: #FFFFFF;
    --fg: #212121;
}

/* Main content area - ensure white background */
.content {
    background: white !important;
    color: #212121 !important;
}

#content main {
    background: white;
    color: #212121;
}

/* PowerCommons header with icon */
h1:first-of-type::before {
    content: "";
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' stroke-width='2' stroke='%23FFCC00' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3Cpath d='M9 2v2'/%3E%3Cpath d='M15 2v2'/%3E%3Cpath d='M9 20v2'/%3E%3Cpath d='M15 20v2'/%3E%3Cpath d='M20 9h2'/%3E%3Cpath d='M20 15h2'/%3E%3Cpath d='M2 9h2'/%3E%3Cpath d='M2 15h2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-right: 0.5rem;
    vertical-align: middle;
    filter: drop-shadow(0 0 3px rgba(255, 204, 0, 0.5));
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Alternative: Use power symbol */
.power-icon::before {
    content: "⏻";
    color: var(--pc-eu-blue);
    font-size: 1.2em;
    margin-right: 0.5rem;
}

/* Hero Banner - EU flag inspired */
.hero-banner {
    background: linear-gradient(135deg, var(--pc-eu-blue) 0%, var(--pc-light-blue) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 51, 153, 0.15);
    position: relative;
    overflow: hidden;
}

/* EU stars circle */
.hero-banner::before {
    content: "⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ ⭐";
    display: block;
    color: var(--pc-eu-gold);
    font-size: 1rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.hero-banner h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Main headings with better visibility */
h1, h2, h3, h4, h5, h6 {
    color: var(--pc-eu-blue) !important;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.2rem !important;  /* ~32px - much bigger */
    border-bottom: 3px solid var(--pc-eu-gold);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2.4rem !important;  /* ~24px */
    color: var(--pc-dark-gray) !important;
    font-weight: 500;
    border-bottom: 1px solid var(--pc-medium-gray);
    padding-bottom: 0.3rem;
    margin-top: 3rem;
}

h3 {
    font-size: 2rem !important;  /* ~20px - clearly bigger than body */
    color: var(--pc-eu-blue) !important;
    font-weight: 600;
    text-transform: none;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Fix anchor links within h3 */
h3 a.header,
h3 a {
    color: var(--pc-eu-blue) !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
    border: none !important;
}

h3 a.header:hover {
    color: var(--pc-eu-blue) !important;
    text-decoration: none !important;
}

h4 {
    font-size: 1.7rem !important;  /* ~17px - slightly bigger than body */
    color: var(--pc-dark-gray) !important;
    font-weight: 500;
}

/* Fix anchor links within h4 */
h4 a.header,
h4 a {
    color: var(--pc-dark-gray) !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
    border: none !important;
}

h4 a.header:hover {
    color: var(--pc-dark-gray) !important;
    text-decoration: none !important;
}

/* Remove competing emoji from h2 */
h2::before {
    content: none;
}

/* Section headers (h2) should be subdued */
.content h2 {
    background: var(--pc-light-gray);
    padding: 0.75rem 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-left: 4px solid var(--pc-eu-blue);
    border-bottom: none;
    color: var(--pc-dark-gray) !important;
}

/* Project titles (h3) should stand out */
.content h3 {
    color: var(--pc-eu-blue) !important;
    font-weight: 700;
    font-size: 1.4rem;
}

/* Remove uppercase from regular headings */
h2, h3, h4, h5, h6 {
    text-transform: none;
    letter-spacing: normal;
}

/* Better paragraph readability */
p {
    line-height: 1.7;
    color: #333333;
    margin: 1rem 0;
}

/* Emphasis text */
strong {
    color: var(--pc-eu-blue);
    font-weight: 600;
}

em {
    color: var(--pc-dark-gray);
}

/* Links with EU blue */
a {
    color: var(--pc-bright-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--pc-eu-blue);
    border-bottom-color: var(--pc-eu-gold);
}

/* Tables with EU styling */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 2rem 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background: var(--pc-eu-blue);
    color: white;
}

table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
}

table tbody tr {
    border-bottom: 1px solid var(--pc-medium-gray);
}

table tbody tr:hover {
    background: var(--pc-light-gray);
}

table tbody td {
    padding: 0.75rem 1rem;
    color: #333333;
}

/* Status indicators with better contrast */
table td:contains("🟢"),
table td:contains("🟡"),
table td:contains("🔵"),
table td:contains("✅") {
    font-size: 1.3rem;
}

/* Progress bars */
table td:contains("█") {
    font-family: monospace;
    letter-spacing: -2px;
    color: var(--pc-sovereignty-green);
}

/* Partners Grid with EU theme */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(to bottom, white, var(--pc-light-gray));
    border-radius: 12px;
    border: 2px solid var(--pc-eu-blue);
    position: relative;
}

.partners-grid::before {
    content: "🇪🇺";
    position: absolute;
    top: -15px;
    left: 20px;
    background: white;
    padding: 0 10px;
    font-size: 1.5rem;
}

.partners-grid li {
    list-style: none;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.partners-grid li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,51,153,0.1);
}

.partners-grid li strong {
    color: var(--pc-eu-blue);
    display: block;
    margin-bottom: 0.5rem;
}

/* CTA Section */
.cta-section {
    background: white;
    border: 2px solid var(--pc-eu-blue);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    position: relative;
}

.cta-section::before {
    content: "⭐";
    position: absolute;
    top: -12px;
    left: 30px;
    background: white;
    color: var(--pc-eu-gold);
    padding: 0 8px;
    font-size: 1.5rem;
}

.cta-section h3 {
    color: var(--pc-eu-blue);
    margin-top: 0;
    font-size: 1.5rem;
}

/* Sidebar improvements */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 3px solid var(--pc-eu-blue);
}

.sidebar .sidebar-scrollbox {
    padding: 1rem;
}

.chapter li.chapter-item {
    margin: 0.5rem 0;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chapter li.chapter-item:hover {
    background: var(--pc-light-gray);
    padding-left: 1rem;
}

.chapter li.chapter-item.active {
    background: var(--pc-eu-blue);
    color: white;
}

.chapter li.chapter-item.active a {
    color: white !important;
}

.chapter li.chapter-item strong {
    color: var(--pc-eu-blue);
    font-weight: 600;
}

.chapter li.chapter-item.active strong {
    color: white;
}

/* Code blocks */
pre {
    background: #F8F9FA !important;
    border: 1px solid var(--pc-medium-gray);
    border-left: 4px solid var(--pc-eu-blue);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
}

pre code {
    color: #333333;
    background: transparent;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--pc-eu-gold);
    background: var(--quote-bg);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    font-style: italic;
    color: #555555;
}

/* Footer */
.footer-links {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    border-top: 3px solid var(--pc-eu-blue);
    margin-top: 3rem;
    background: var(--pc-light-gray);
}

/* Buttons */
button, .button, input[type="submit"] {
    background: var(--pc-eu-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,51,153,0.2);
}

button:hover, .button:hover, input[type="submit"]:hover {
    background: var(--pc-light-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,51,153,0.3);
}

/* Menu bar adjustments */
#menu-bar {
    background: var(--pc-eu-blue);
    color: white;
    border-bottom: 3px solid var(--pc-eu-gold);
}

#menu-bar i {
    color: white;
}

#menu-bar i:hover {
    color: var(--pc-eu-gold);
}

/* Search */
#searchbar {
    border: 2px solid var(--pc-eu-blue);
    border-radius: 6px;
    padding: 0.5rem;
}

#searchbar:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,51,153,0.1);
}

/* Admonitions */
.admonition {
    border-left-width: 4px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admonition.sovereignty {
    border-left-color: var(--pc-sovereignty-green);
    background: rgba(46, 125, 50, 0.05);
}

.admonition.info {
    border-left-color: var(--pc-eu-blue);
    background: rgba(0, 51, 153, 0.05);
}

.admonition.warning {
    border-left-color: var(--pc-warning-orange);
    background: rgba(255, 111, 0, 0.05);
}

/* Accessibility */
a:focus,
button:focus,
input:focus {
    outline: 3px solid var(--pc-eu-gold);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .hero-banner {
        background: none;
        border: 2px solid var(--pc-eu-blue);
        color: black;
    }
    
    .sidebar {
        display: none;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .hero-banner {
        padding: 1.5rem 1rem;
    }
    
    .partners-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CRITICAL OVERRIDES - MUST BE AT END OF FILE
   ============================================ */

/* Fix menu bar title visibility */
#menu-bar {
    background: var(--pc-eu-blue) !important;
}

#menu-bar .menu-title {
    color: white !important;
    font-weight: 600;
}

#menu-bar h3.menu-title {
    color: white !important;
}

/* Fix all menu bar text and icons */
#menu-bar,
#menu-bar *,
#menu-bar i,
#menu-bar a,
#menu-bar .left-buttons,
#menu-bar .right-buttons {
    color: white !important;
}

/* Fix hero banner text - MAXIMUM SPECIFICITY */
.hero-banner {
    background: var(--pc-eu-blue) !important;
}

.hero-banner h3#building-europes-digital-sovereignty-through-open-silicon a.header,
.hero-banner h3 a.header,
.hero-banner a.header {
    color: white !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Override any anchor link colors in hero banner */
.hero-banner a:link,
.hero-banner a:visited,
.hero-banner a:hover,
.hero-banner a:active {
    color: white !important;
}