/**
 * File: app.css
 * Path: /value/public/assets/css/app.css
 * Purpose: Provides the base styling for the WoS Value project with a simple white layout and mobile-friendly tables/forms.
 */

/* -----------------------------------------------------------------------------
   Base
----------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #ffffff;
    color: #222222;
    line-height: 1.4;
}

/* -----------------------------------------------------------------------------
   Top Navigation
----------------------------------------------------------------------------- */

.top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 12px;
    background: #f4f4f4;
    border-radius: 6px;
    color: #222;
    user-select: none;
    border: 1px solid #dddddd;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown[open] summary {
    background: #e8e8e8;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1000;
}

.nav-dropdown-menu a {
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
    color: #222;
    background: #f8f8f8;
}

.nav-dropdown-menu a:hover {
    background: #ececec;
}

/* -----------------------------------------------------------------------------
   Layout
----------------------------------------------------------------------------- */

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.page.page-wide {
    max-width: none;
    width: 100%;
}

.admin-wide {
    max-width: none;
    width: 100%;
}

.group-row td {
    background: #f3f3f3;
    font-weight: 700;
}

.admin-wide .value-table {
    min-width: 1500px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 12px;
    font-size: 28px;
}

.page-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.page-nav a {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    text-decoration: none;
    color: #222222;
    background: #f9f9f9;
}

.content-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.card {
    background: #ffffff;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 16px;
}

.card h2 {
    margin-top: 0;
    font-size: 22px;
}

.search-select {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-select input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    font-size: 16px;
    background: #ffffff;
}

.search-select select {
    width: 100%;
}
            
/* -----------------------------------------------------------------------------
   Links styled like buttons
----------------------------------------------------------------------------- */

.button-link {
    display: inline-block;
    margin-left: 10px;
    padding: 10px 16px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #f9f9f9;
    text-decoration: none;
    color: #222222;
}


/* -----------------------------------------------------------------------------
   Forms
----------------------------------------------------------------------------- */

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    font-size: 16px;
    background: #ffffff;
}

.form-row-checkbox label {
    font-weight: 400;
}

.form-actions {
    margin-top: 6px;
}

.form-actions button {
    padding: 10px 16px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #f3f3f3;
    cursor: pointer;
    font-size: 16px;
}

/* -----------------------------------------------------------------------------
   Tables
----------------------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
}

.value-table {
    min-width: 1400px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table th {
    cursor: pointer;
    user-select: none;
}


.data-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f7f7f7;
}

/* -----------------------------------------------------------------------------
   Alerts
----------------------------------------------------------------------------- */

.alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 6px;
}

.alert-error {
    background: #fff1f1;
    border: 1px solid #efcaca;
}

.alert-success {
    background: #f1fff2;
    border: 1px solid #cbe7cd;
}

/* -----------------------------------------------------------------------------
   Responsive
----------------------------------------------------------------------------- */

@media (min-width: 900px) {
    .content-grid {
        grid-template-columns: 420px 1fr;
        align-items: start;
    }
}
