/**
 * Main Stylesheet - 17track.net Style
 */

/* CSS Variables - Blue Theme */
:root {
    --primary-color: #1e88e5;
    --primary-hover: #1565c0;
    --primary-light: #e3f2fd;
    --primary-dark: #0d47a1;
    --secondary-color: #42a5f5;
    --accent-color: #ff9800;

    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --info-color: #29b6f6;

    --bg-color: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-dark: #263238;

    --text-color: #212121;
    --text-secondary: #757575;
    --text-muted: #9e9e9e;
    --border-color: #e0e0e0;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;

    --transition: all 0.2s ease;
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.navbar {
    background: var(--bg-secondary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-color);
    border-color: var(--text-muted);
}

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

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-color);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-color);
}

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

/* Main Content */
.main-content {
    padding: 1.5rem 0;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Search */
.search-input-wrapper {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-input-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.9375rem;
    outline: none;
}

.search-input-wrapper .btn {
    border-radius: 0;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Tables */
.data-table {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-secondary);
}

.data-table tr:hover {
    background: var(--primary-light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-color);
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1rem;
}

.pagination button,
.pagination a {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.pagination button:hover:not(:disabled),
.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination button.active,
.pagination a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.8);
    padding: 2rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-brand .logo-text {
    color: white;
}

.footer-brand p {
    color: rgba(255,255,255,0.6);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-column h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: white;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.375rem;
}

.footer-column a {
    color: rgba(255,255,255,0.6);
    font-size: 0.8125rem;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.8125rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Nav Avatar */
.nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(100%); opacity: 0; }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease;
    color: white;
}
