/* =========================================
   Pinball Rubber Kit Database - Styles
   ========================================= */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #58a6ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #79c0ff;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, #161b22 0%, #1c2333 100%);
    border-bottom: 1px solid #30363d;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.home-link {
    color: #58a6ff;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none !important;
}

.home-link::before {
    content: "\2190";
    margin-right: 6px;
    display: inline-block;
}

.home-link:hover {
    color: #79c0ff;
    text-decoration: underline !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}
    max-width: 100%;
    overflow: hidden;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
    max-width: 100%;
}

.logo-text {
    white-space: nowrap;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f0f6fc !important;
    background: linear-gradient(135deg, #f0f6fc, #58a6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: #8b949e;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.main-nav a:hover {
    color: #f0f6fc;
    text-decoration: none;
    border-bottom-color: #58a6ff;
}

/* Flash Messages */
.flash {
    padding: 12px 0;
    font-weight: 500;
}

.flash-success {
    background: #1a3a2a;
    color: #7ee787;
    border-bottom: 1px solid #238636;
}

.flash-warning {
    background: #3a2a1a;
    color: #d29922;
    border-bottom: 1px solid #9e6a03;
}

.flash-error {
    background: #3a1a1a;
    color: #ff7b72;
    border-bottom: 1px solid #da3633;
}

/* Main Content */
main {
    flex: 1;
    padding: 30px 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 0 30px;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #f0f6fc;
    margin-bottom: 12px;
}

.hero p {
    color: #8b949e;
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 25px;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #30363d;
    border-radius: 8px;
    font-size: 1rem;
    background: #161b22;
    color: #c9d1d9;
    transition: border-color 0.2s;
}

.search-form input[type="text"]:focus {
    outline: none;
    border-color: #58a6ff;
}

.search-form button {
    padding: 12px 24px;
    background: #238636;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-form button:hover {
    background: #2ea043;
}

.btn-clear {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: #21262d;
    color: #c9d1d9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-clear:hover {
    background: #30363d;
    text-decoration: none;
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0 30px;
    flex-wrap: wrap;
}

.stat-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px 30px;
    text-align: center;
    min-width: 140px;
}

.stat-box strong {
    display: block;
    font-size: 1.8rem;
    color: #f0f6fc;
}

.stat-box span {
    color: #8b949e;
    font-size: 0.9rem;
}

/* Machine Grid */
.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.machine-card {
    display: block;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.machine-card:hover {
    border-color: #58a6ff;
    background: #1c2333;
    transform: translateY(-2px);
    text-decoration: none;
}

.machine-card h3 {
    font-size: 1.15rem;
    color: #f0f6fc;
    margin-bottom: 8px;
}

.machine-card .meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.machine-card .manufacturer {
    color: #58a6ff;
    font-size: 0.85rem;
    font-weight: 500;
}

.machine-card .year {
    color: #8b949e;
    font-size: 0.85rem;
}

.machine-card .rubber-count {
    color: #7ee787;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h1, .empty-state h2 {
    color: #f0f6fc;
    margin-bottom: 12px;
}

.empty-state p {
    color: #8b949e;
    margin-bottom: 20px;
}

/* Buttons */
.btn, button.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #238636;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    line-height: 1.4;
}

.btn:hover {
    background: #2ea043;
    text-decoration: none;
    color: #fff;
}

.btn-secondary {
    background: #21262d;
}

.btn-secondary:hover {
    background: #30363d;
}

.btn-warning {
    background: #9e6a03;
}

.btn-warning:hover {
    background: #bb8009;
}

.btn-danger {
    background: #da3633;
}

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

.btn-success {
    background: #238636;
}

.btn-lg {
    padding: 14px 30px;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: #58a6ff;
    text-decoration: none;
}

.page-link.active {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #fff;
}

/* Forms */
.form-section {
    max-width: 900px;
    margin: 0 auto;
}

.form-section-narrow {
    max-width: 450px;
}

.form-section h1 {
    color: #f0f6fc;
    margin-bottom: 8px;
}

.form-section > p {
    color: #8b949e;
    margin-bottom: 25px;
}

.kit-form fieldset {
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    background: #161b22;
}

.kit-form legend {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f0f6fc;
    padding: 0 10px;
}

.kit-form legend small {
    font-weight: 400;
    color: #8b949e;
    font-size: 0.85rem;
}

.fieldset-desc {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #c9d1d9;
    margin-bottom: 5px;
}

.form-row .required {
    color: #f85149;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #30363d;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #0d1117;
    color: #c9d1d9;
    transition: border-color 0.2s;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #58a6ff;
}

.form-row textarea {
    resize: vertical;
}

.form-row select {
    cursor: pointer;
}

.readonly-input {
    background: #1c2333 !important;
    cursor: default;
    border-color: #21262d !important;
}

/* Rubber Sizes Table */
#rubberSizesContainer {
    margin-bottom: 12px;
}

.rubber-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 8px;
    padding: 12px;
    background: #0d1117;
    border-radius: 8px;
    border: 1px solid #21262d;
    transition: all 0.2s;
}

.rubber-row.has-quantity {
    border-color: #238636;
    background: #111d17;
}

.rubber-field {
    flex: 1;
}

.rubber-field label {
    display: block;
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 4px;
}

.rubber-size-label {
    flex: 2;
}

.rubber-qty {
    max-width: 80px;
    min-width: 70px;
}

.rubber-color {
    min-width: 110px;
}

.rubber-size-type {
    min-width: 90px;
}

.rubber-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #161b22;
    color: #c9d1d9;
    cursor: pointer;
}

.rubber-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #161b22;
    color: #c9d1d9;
}

.rubber-field input:focus {
    outline: none;
    border-color: #58a6ff;
}

.rubber-field input[type="number"] {
    text-align: center;
}

.qty-input {
    font-weight: 600;
}

input[type="number"]:focus {
    border-color: #58a6ff;
}

.btn-remove {
    background: #da3633;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #f85149;
}

.rubber-actions {
    margin-top: 8px;
}

/* Form Actions */
.form-actions {
    text-align: center;
    padding: 10px 0 20px;
}

/* Error Box */
.error-box {
    background: #3a1a1a;
    border: 1px solid #da3633;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.error-box strong {
    color: #ff7b72;
}

.error-box ul {
    margin: 8px 0 0 20px;
    color: #ffa198;
}

/* Success Page */
.success-page {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    font-size: 4rem;
    color: #7ee787;
    margin-bottom: 16px;
}

.success-page h1 {
    color: #f0f6fc;
    margin-bottom: 12px;
}

.success-page p {
    color: #8b949e;
    margin-bottom: 8px;
}

.success-page .actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* Kit Detail Page */
.kit-detail {
    max-width: 900px;
    margin: 0 auto;
}

.kit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.kit-header h1 {
    font-size: 2rem;
    color: #f0f6fc;
    margin-bottom: 8px;
}

.kit-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: #1c2333;
    border: 1px solid #30363d;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #c9d1d9;
}

.badge-rubber {
    background: #111d17;
    border-color: #238636;
    color: #7ee787;
}

.kit-notes {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.kit-notes h3 {
    color: #f0f6fc;
    font-size: 1rem;
    margin-bottom: 8px;
}

.kit-notes p {
    color: #8b949e;
    line-height: 1.7;
}

/* Rubber Table */
.rubber-table-wrapper {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.rubber-table-wrapper h2 {
    color: #f0f6fc;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

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

.rubber-table th {
    text-align: left;
    padding: 10px 14px;
    background: #0d1117;
    border-bottom: 2px solid #30363d;
    font-size: 0.85rem;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rubber-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #21262d;
    color: #c9d1d9;
}

.rubber-table tr:last-child td {
    border-bottom: none;
}

.rubber-table .qty-col {
    text-align: center;
    width: 80px;
}

.rubber-table tfoot td {
    border-top: 2px solid #30363d;
    border-bottom: none;
    padding-top: 14px;
}

.submitted-info {
    color: #8b949e;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
}

/* Admin */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-header h1 {
    color: #f0f6fc;
    font-size: 1.6rem;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8b949e;
    flex-wrap: wrap;
}

.admin-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 16px 24px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-card strong {
    display: block;
    font-size: 1.6rem;
    color: #f0f6fc;
}

.stat-card span {
    color: #8b949e;
    font-size: 0.85rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #30363d;
}

.tab {
    padding: 10px 20px;
    color: #8b949e;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.tab:hover {
    color: #f0f6fc;
    text-decoration: none;
}

.tab.active {
    color: #f0f6fc;
    border-bottom-color: #58a6ff;
}

/* Admin Table */
.admin-table-wrapper {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 0;
    overflow-x: auto;
}

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

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    background: #0d1117;
    border-bottom: 2px solid #30363d;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #21262d;
    color: #c9d1d9;
    font-size: 0.9rem;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #1c2333;
}

.admin-table .actions-col {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    padding: 10px 16px;
}

.admin-table td small {
    color: #8b949e;
}

/* Footer */
.site-footer {
    background: #161b22;
    border-top: 1px solid #30363d;
    padding: 20px 0;
    text-align: center;
}

.site-footer p {
    color: #8b949e;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        align-items: center;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .machine-grid {
        grid-template-columns: 1fr;
    }
    
    .rubber-row {
        flex-wrap: wrap;
    }
    
    .rubber-size-label {
        flex: 1 1 100%;
    }
    
    .rubber-qty {
        max-width: none;
        min-width: 80px;
    }
    
    .admin-table .actions-col {
        flex-direction: column;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kit-header {
        flex-direction: column;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-box {
        width: 100%;
        max-width: 300px;
    }
}
