:root {
    --bg-color: #0c0e12;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #3390ec;
    --error-color: #ff4d4d;
    --success-color: #4cd964;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    overflow-x: hidden;
    min-height: 100vh;
    background-attachment: fixed;
}

.dark-mode {
    background: radial-gradient(circle at 50% 0%, #1c2533 0%, #0c0e12 100%);
}

#app {
    padding-bottom: 80px; 
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
.glass-header {
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glass-header h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

#header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: white;
    transition: all 0.2s;
    outline: none;
}

.admin-icon-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}

.user-badge {
    background: var(--accent-color);
    padding: 0 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.limit-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    padding: 0 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    white-space: nowrap;
}

.limit-badge.low-limit {
    border-color: var(--error-color);
    color: var(--error-color);
    background: rgba(255, 77, 77, 0.1);
}

/* Cards & Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.4);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.glass-card:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.12);
}

.category-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    aspect-ratio: 1;
}

.category-card h3 {
    margin: 10px 0 5px 0;
    font-size: 1rem;
}

.category-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* List View */
.list-container {
    padding: 10px 20px;
}

.service-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
    padding: 18px 20px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.service-item:active {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
}

.chevron {
    color: var(--accent-color);
    font-weight: bold;
    opacity: 0.7;
}

/* Forms */
.form-container {
    padding: 20px;
}

.input-group {
    margin-top: 20px;
}

input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input[type="text"]:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

#form-extras {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

@media (max-width: 480px) {
    #form-extras {
        grid-template-columns: 1fr;
    }
}

.dynamic-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.dynamic-field:focus {
    border-color: var(--accent-color);
}

/* Results */
.results-container {
    padding: 20px;
}

.result-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 15px;
    padding: 15px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    gap: 15px;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-value {
    font-weight: 500;
    font-size: 0.9rem;
    text-align: right;
    color: var(--text-primary);
    word-break: break-word;
}

/* Loader */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Error Screen */
.error-container {
    padding: 40px 20px;
    text-align: center;
}

#error-title {
    color: var(--error-color);
}

/* Admin Styles */
.admin-container {
    padding: 20px;
}

.admin-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.85rem;
}

.user-table th, .user-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    word-break: break-all;
}

.user-table th {
    color: var(--text-secondary);
    font-weight: 500;
}

.badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge.admin {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

.badge.user {
    background: rgba(51, 144, 236, 0.2);
    color: var(--accent-color);
}

/* Glass Buttons */
.glass-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.glass-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
}

.glass-btn.danger {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.glass-btn.xs {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 8px;
}

.glass-btn:active {
    transform: scale(0.95);
}

/* Modal/Forms */
.modal {
    position: relative;
    z-index: 10;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 15px;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
}

input[type="date"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 15px;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

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