/* styles.css */

/* ===========================
   VARIABLES & THEME
   =========================== */
:root {
  --zurich-blue: #003399;
  --zurich-hover: #002266;
  --zurich-light-blue: #E6F0FF;
  --text-main: #333333;
  --text-muted: #666666;
  --bg-body: #F4F7FA;
  --bg-surface: #FFFFFF;
  --border-color: #E0E0E0;
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --error: #C62828;
  --error-bg: #FFEBEE;
  --radius: 8px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* ===========================
   RESET & BASE
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    /* Zurich Standard Font Stack */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    padding: 2rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* ===========================
   TYPOGRAPHY
   =========================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--zurich-blue);
    line-height: 1.25;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
    color: var(--zurich-blue);
}

h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--text-main);
}

h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--zurich-blue);
}

h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

p {
    margin-bottom: 1rem;
    text-align: justify; /* Consistent with your request */
}

/* ===========================
   LAYOUT & STRUCTURE
   =========================== */

header {
    margin-bottom: 3rem;
    text-align: center;
}

header p {
    text-align: center;
    color: var(--text-muted);
}

/* ===========================
   DEMO BOXES (THE CARDS)
   =========================== */

.demo-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.demo-box:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

/* ===========================
   FORMS & INPUTS
   =========================== */

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    display: block;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
input[type="file"] {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px; /* Slightly rounded inputs */
    background-color: #fff;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--zurich-blue);
    box-shadow: 0 0 0 3px var(--zurich-light-blue);
}

fieldset {
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

legend {
    font-weight: 600;
    padding: 0 0.5rem;
    color: var(--zurich-blue);
}

/* ===========================
   BUTTONS
   =========================== */

button {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border: none;
    background-color: var(--zurich-blue);
    color: #fff;
    cursor: pointer;
    border-radius: 50px; /* Pill shaped buttons */
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    background-color: var(--zurich-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,51,153, 0.2);
}

button:disabled {
    background-color: #BDC3C7;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===========================
   LINKS
   =========================== */

a {
    color: var(--zurich-blue);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
}

a:hover {
    border-bottom-color: var(--zurich-blue);
}

/* ===========================
   CODE & DETAILS
   =========================== */

details {
    margin-top: 1.5rem;
    background: #f8f9fa;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

summary {
    font-weight: 600;
    cursor: pointer;
    padding: 1rem;
    color: var(--zurich-blue);
    user-select: none;
}

summary:hover {
    background-color: var(--zurich-light-blue);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Code Blocks Styling */
pre {
    padding: 1rem;
    background: transparent;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9rem;
    color: #444;
    border-top: 1px solid var(--border-color);
}

/* Inline code inside normal text */
p code, li code {
    background: var(--zurich-light-blue);
    color: var(--zurich-blue);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9em;
}

/* Fix for code block backgrounds */
pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* ===========================
   COMPONENTS: ALERTS
   =========================== */

.alert {
    padding: 1rem;
    border-radius: var(--radius); 
    margin-bottom: 1rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border-color: #C8E6C9;
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error);
    border-color: #FFCDD2;
}

.spinner {
    padding: 1rem;
    background: #FAFAFA;
    border: 1px dashed #ccc;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* ===========================
   COMPONENTS: TABLES
   =========================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    border-top: none;
}

th {
    font-weight: 600;
    color: var(--zurich-blue);
    background-color: #FAFAFA;
}

tr:hover td {
    background-color: var(--zurich-light-blue);
}

/* ===========================
   COMPONENTS: TABS & ACCORDION
   =========================== */

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tabs button {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    margin: 0;
    padding: 0.75rem 1.5rem;
    box-shadow: none;
}

.tabs button:hover {
    color: var(--zurich-blue);
    background: transparent;
    transform: none;
    box-shadow: none;
}

.tabs button[aria-selected="true"] {
    color: var(--zurich-blue);
    border-bottom-color: var(--zurich-blue);
    font-weight: 700;
}

[role="tabpanel"] {
    padding: 1rem 0;
    border: none;
    animation: fadeIn 0.3s ease;
}

/* Accordion */
.accordion-trigger {
    width: 100%;
    text-align: left;
    background: #f8f9fa;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-shadow: none;
}

.accordion-trigger[aria-expanded="true"] {
    background-color: var(--zurich-blue);
    color: #fff;
    border-color: var(--zurich-blue);
}

.accordion > div[id] {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-top: none;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    border-radius: 0 0 4px 4px;
}

/* ===========================
   COMPONENTS: NAVIGATION & MENUS
   =========================== */

/* ===========================
   COMPONENTS: NAVIGATION & MENUS
   =========================== */

nav {
    border: none;
    background: var(--bg-surface);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: var(--radius);
}

/* Fix: Remove bullets and setup layout */
ul.menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

/* Fix: Create a positioning context for the dropdown */
ul.menu > li {
    position: relative;
    list-style: none; /* Double check to remove bullet */
}

.menu-trigger {
    margin: 0; /* Remove default button margins */
}

/* Submenu Styling */
.submenu {
    position: absolute;
    top: 110%; /* Push it slightly down from the button */
    left: 0;
    border: 1px solid var(--border-color);
    background-color: #fff;
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: var(--radius);
    list-style: none; /* Remove bullets from submenu too */
}

.submenu li {
    display: block;
    margin: 0;
}

.submenu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-weight: 500;
    border-bottom: none;
    transition: background 0.2s;
}

.submenu li a:hover {
    background-color: var(--zurich-light-blue);
    color: var(--zurich-blue);
}

/* ===========================
   COMPONENTS: DRAG & DROP
   =========================== */

.drag-drop-container {
    display: flex;
    gap: 1.5rem;
}

.drag-source,
.drag-target {
    flex: 1;
    background: #FAFAFA;
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    padding: 1rem;
    min-height: 200px;
}

.drag-source li,
.drag-target li {
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.drag-source li:hover,
.drag-target li:hover {
    border-color: var(--zurich-blue);
    color: var(--zurich-blue);
}

/* ===========================
   COMPONENTS: MODAL
   =========================== */

#modal-root {
    background-color: rgba(0, 0, 0, 0.5); /* Modern dimming */
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #fff;
    border: none;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-top: 0;
}

/* ===========================
   UTILITIES & FOOTER
   =========================== */

.date-picker {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    background: #fff;
}

footer {
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

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

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    body { padding: 1rem; }
    h1 { font-size: 2rem; }
    .drag-drop-container { flex-direction: column; }
    .demo-box { padding: 1.5rem; }
}