/* Smooth - Minimal, functional CSS */

:root {
    /* Loobric Brand Colors */
    --primary: #204A3E;        /* Deep Green */
    --primary-dark: #1A3B32;
    --primary-light: #4F7B65;  /* Leaf Accent */
    --accent: #66B0A6;         /* Aqua Edge (Tech Accent) */
    --accent-dark: #4F8A82;
    --success: #4F7B65;
    --danger: #dc2626;
    --bg: #F7F6F3;             /* Mist White */
    --surface: #ffffff;
    --border: #E9E6E0;         /* Soft Sand */
    --text: #3A3A3A;           /* Graphite Gray */
    --text-muted: #6b7280;
    --charcoal: #1D1D1B;       /* Charcoal Black */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.loobric-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 1.5rem;
    height: 100%;
}

.loobric-link:hover {
    color: var(--primary-light);
}

.loobric-icon {
    height: 45px;
    width: auto;
    display: block;
    transition: opacity 0.2s;
}

.loobric-link:hover .loobric-icon {
    opacity: 0.8;
}

.loobric-text {
    font-size: 1.5rem;
}

.divider {
    color: var(--border);
    font-weight: 300;
    font-size: 1.5rem;
}

.powered-by {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.powered-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.smooth-link {
    font-size: 0.875rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.smooth-link:hover {
    color: var(--primary);
}

.github-link {
    font-size: 0.625rem;
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.github-link:hover {
    color: var(--primary);
}

header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

header nav > a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

header nav > a:hover {
    color: var(--primary);
}

.user-email {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-family: inherit;
}

.dropdown-toggle:hover {
    color: var(--primary);
    background: var(--bg);
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.625rem;
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
    font-family: inherit;
}

.dropdown-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.dropdown-form {
    margin: 0;
}

.dropdown-menu .dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-menu .dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: var(--bg);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 1rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-muted {
    background: var(--border);
    color: var(--text-muted);
}

/* Code */
code {
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

.code-block {
    background: var(--bg);
    padding: 1rem;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Tool Items UI */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-section h1 {
    font-size: 2rem;
    font-weight: 600;
}

.header-section .actions {
    display: flex;
    gap: 1rem;
}

/* Filters */
.filters {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.filter-form label {
    font-weight: 500;
}

/* Data Table */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.data-table thead {
    background: var(--bg);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: var(--bg);
}

.data-table td.actions {
    display: flex;
    gap: 0.5rem;
}

.data-table .empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Type Badges */
.type-cutting_tool {
    background: #dbeafe;
    color: #1e40af;
}

.type-holder {
    background: #f3e8ff;
    color: #6b21a8;
}

.type-insert {
    background: #fed7aa;
    color: #c2410c;
}

.type-adapter {
    background: #d1fae5;
    color: #065f46;
}

/* Status Badges */
.status-available {
    background: #d1fae5;
    color: #065f46;
}

.status-in_use {
    background: #dbeafe;
    color: #1e40af;
}

.status-needs_inspection {
    background: #fed7aa;
    color: #c2410c;
}

.status-retired {
    background: #e5e7eb;
    color: #6b7280;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.selected-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.form-help {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.required {
    color: var(--danger);
}

textarea {
    font-family: 'Monaco', 'Courier New', monospace;
    resize: vertical;
}

input.error,
textarea.error {
    border-color: var(--danger);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Footer */
footer {
    background: var(--charcoal);
    color: rgba(247, 246, 243, 0.7);
    margin-top: 5rem;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section h4 {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-description {
    font-size: 0.875rem;
    line-height: 1.5;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(247, 246, 243, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(58, 58, 58, 0.5);
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.875rem;
    margin: 0;
}

/* Main content area */
main {
    min-height: calc(100vh - 400px);
}

/* Dashboard Styles */
.dashboard-welcome {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text);
}

.account-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1rem;
    color: var(--text);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
}

.section-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.section-link:hover {
    color: var(--primary-light);
}

.section-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Dashboard Tiles (smaller, for admin section) */
.dashboard-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dashboard-tile:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--primary);
    transition: all 0.2s;
}

.dashboard-tile:hover .dashboard-tile-icon {
    background: var(--primary);
    color: white;
}

.dashboard-tile-icon svg {
    width: 20px;
    height: 20px;
}

.dashboard-tile h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.tool-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-tile:hover {
    background: var(--bg);
    border-color: var(--primary);
}

.tool-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary);
    transition: all 0.2s;
}

.tool-tile:hover .tool-tile-icon {
    background: var(--primary);
    color: white;
}

.tool-tile-icon svg {
    width: 24px;
    height: 24px;
}

.tool-tile h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.tool-tile p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Quick Links */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
    font-weight: 500;
}

.quick-link:hover {
    background: var(--bg);
    color: var(--primary);
}

.quick-link-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Tutorial Styles */
.tutorial-section {
    margin-bottom: 2rem;
}

.tutorial-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.tutorial-section p {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tutorial-list {
    color: var(--text);
    line-height: 1.8;
    margin-left: 1.5rem;
}

.tutorial-list li {
    margin-bottom: 0.75rem;
}

.tutorial-list strong {
    color: var(--primary);
}

/* Admin Tiles */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.admin-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.admin-tile:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.admin-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary);
    transition: all 0.2s;
}

.admin-tile:hover .admin-tile-icon {
    background: var(--primary);
    color: white;
}

.admin-tile-icon svg {
    width: 24px;
    height: 24px;
}

.admin-tile h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.admin-tile p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}
