:root {
    --primary: #f08a30; /* Extracting the orange from logo */
    --primary-hover: #d17522;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-darker);
    background-image: 
        radial-gradient(at 0% 0%, rgba(15, 23, 42, 1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, rgba(240, 138, 48, 0.1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, rgba(15, 23, 42, 1) 0, transparent 50%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 380px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid var(--panel-border);
    background: rgba(15, 23, 42, 0.8);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent; 
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3); 
}

.logo-container {
    text-align: center;
    margin-bottom: 10px;
}

.logo-container img {
    max-width: 80%;
    height: auto;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.5));
}

#logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
}

#logo-text span {
    color: var(--primary);
    text-transform: lowercase;
}

.sidebar h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

/* Inputs */
.presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.preset-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

.preset-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
}

.custom-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--panel-border);
    padding: 12px;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
}

.room-area {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
    font-size: 1.1rem;
}

/* Results */
.result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.result-row span {
    color: var(--text-muted);
}

hr {
    border: none;
    border-top: 1px solid var(--panel-border);
    margin: 16px 0;
}

.result-highlight {
    background: rgba(0,0,0,0.2);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.result-highlight p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.result-highlight h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.total-cost {
    background: linear-gradient(135deg, rgba(240, 138, 48, 0.2) 0%, rgba(240, 138, 48, 0.05) 100%);
    border: 1px solid rgba(240, 138, 48, 0.3);
}
.total-cost h3 {
    color: var(--primary);
}

#admin-btn {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: auto;
    transition: all 0.2s;
}
#admin-btn:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

header h2 {
    font-size: 2rem;
    font-weight: 300;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 12px 12px 12px 40px;
    border-radius: 30px;
    color: white;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--primary);
}

.icon-btn {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--primary);
    transform: scale(1.05);
}

/* Catalog Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.tile-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    position: relative;
}

.tile-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 190px;
}

.tile-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

.tile-card.selected {
    border: 2px solid var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 0 20px rgba(240, 138, 48, 0.4);
}

.tile-card .selected-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.tile-card.selected .selected-badge {
    display: flex;
}

.tile-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--panel-border);
}

.tile-info {
    padding: 16px;
}

.tile-info h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.tile-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 900px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}
.close:hover { color: white; }

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 24px;
}

.admin-form .input-row {
    display: flex;
    gap: 16px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

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

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    margin-left: 10px;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

/* Admin Tile List */
.tile-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.admin-tile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}

.admin-tile-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.admin-tile-info {
    flex: 1;
}
.admin-tile-info h4 {
    font-size: 1rem;
}
.admin-tile-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.admin-actions button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.admin-actions button.edit-btn:hover { color: var(--accent); background: rgba(56, 189, 248, 0.1); }
.admin-actions button.delete-btn:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }

/* Responsive */
@media (max-width: 900px) {
    body { background-attachment: scroll; }
    .app-container {
        flex-direction: column;
        overflow: auto;
    }
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }
    .main-content {
        padding: 20px;
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
}
