/* --- Stylesheet for Charto webapp --- */

/* --- Global Styles & Brand Colors --- */
:root {
    --primary-blue: #0066CC;
    --secondary-green: #10B981;
    --text-dark: #334155;
    --alert-red: #EF4444;
    --background-light: #F8FAFC;
    --card-white: #FFFFFF;
    --text-light: #475569;
    --border-color: #d1d5db;
    --button-light-gray: #E5E7EB;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Layout --- */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 3rem;
    flex-grow: 1;
    box-sizing: border-box;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 1.5rem 0;
}

.card {
    background-color: var(--card-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* --- Navigation --- */
.main-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 99px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    flex-grow: 1;
}
.nav-link {
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    border-radius: 99px;
    transition: all 0.2s ease-in-out;
}
.nav-link:hover {
    background-color: #E2E8F0;
    color: var(--text-dark);
}
.nav-link.active {
    background-color: var(--primary-blue);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

/* --- Sub Navigation --- */
.sub-nav {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.sub-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
}
.sub-nav a {
    display: block;
    padding: 0.75rem 0.25rem;
    margin-bottom: -1px; /* Overlap border */
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.sub-nav a:hover {
    color: var(--text-dark);
}
.sub-nav a.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

/* --- Header --- */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.header-logo { height: 36px; width: 36px; }
.auth-logo { height: 60px; width: 60px; margin-bottom: 1rem; }
.header-left, .header-right { display: flex; align-items: center; gap: 0.75rem; }

.header-add-button {
    background-color: var(--primary-blue);
    color: white;
    white-space: nowrap;
    padding: 0.6rem 1.3rem;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.header-add-button:hover { background-color: #0056b3; }

/* --- Footer --- */
.app-footer {
    width: 100%;
    text-align: center;
    padding: 1.5rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* --- Buttons & Forms --- */
button, .button {
    border: none; padding: 0.8rem 1.5rem; border-radius: 8px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s, transform 0.1s;
}
button:disabled { opacity: 0.6; cursor: not-allowed; }
button:active { transform: scale(0.98); }

.logout-button { background-color: var(--button-light-gray); color: var(--text-dark); }
.logout-button:hover { background-color: #D1D5DB; }

.icon-button {
    background-color: transparent; color: var(--text-light); padding: 0.5rem; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
}
.icon-button:hover { background-color: #f1f5f9; color: var(--text-dark); }
.icon-button svg { width: 20px; height: 20px; }

input, select {
    padding: 0.8rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; color: var(--text-dark); background-color: #FFF; width: 100%; box-sizing: border-box;
}
label { font-weight: 500; color: var(--text-dark); display: block; margin-bottom: 0.5rem; }

/* --- CSV Uploader --- */
.uploader-box {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    background-color: #f9fafb;
}
.uploader-box p {
    color: var(--text-light);
    margin-top: 0.5rem;
}
.uploader-box input[type="file"] {
    display: none;
}
.upload-label {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 1; transition: opacity 0.2s ease-in-out;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-content {
    background: white; padding: 1.5rem; border-radius: 12px; width: 90%; max-width: 700px; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .app-header { flex-direction: column; align-items: center; }
    .main-nav { width: 100%; justify-content: center; }
    .header-right { order: -1; }
    .app-container { padding: 1rem; }
}