:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(31, 40, 51, 0.6);
    --primary: #66fcf1;
    --primary-hover: #45a29e;
    --secondary: #c5c6c7;
    --text-main: #ffffff;
    --border: rgba(102, 252, 241, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(69, 162, 158, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(102, 252, 241, 0.05) 0%, transparent 50%);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.3s ease;
}
a:hover { color: var(--text-main); }

.w-100 { width: 100%; }
.mt-20 { margin-top: 20px; }

/* HEADER */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 12, 16, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(102,252,241,0.3);
}

.credit-badge {
    background: rgba(102, 252, 241, 0.1);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    margin-right: 15px;
}

/* BUTTONS */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(102,252,241,0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(102,252,241,0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary);
    border: 1px solid var(--secondary);
}
.btn-secondary:hover {
    background: rgba(197, 198, 199, 0.1);
    color: var(--text-main);
}

/* GLASS CARD */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* AUTH VIEWS */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 20px;
}
.auth-container .glass-card {
    width: 100%;
    max-width: 400px;
}
.auth-container h2 {
    margin-bottom: 20px;
    text-align: center;
}

.input-group {
    margin-bottom: 15px;
}
.input-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary);
    font-size: 0.9rem;
}
.input-group input, .input-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: 0.3s;
}
.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(102,252,241,0.3);
}
.switch-auth {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

/* DASHBOARD */
.dashboard-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}
.dashboard-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.subtitle {
    color: var(--secondary);
    margin-bottom: 40px;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.tool-card {
    display: block;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}
.tool-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
}
.tool-card h3 {
    margin-bottom: 10px;
    color: var(--text-main);
}
.tool-card p {
    color: var(--secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}
.tool-card .cost {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(102, 252, 241, 0.1);
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* TOOL SPECIFIC VIEWS */
.tool-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}
.back-link {
    display: inline-block;
    margin-bottom: 20px;
}
.tool-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
.badge {
    background: rgba(197, 198, 199, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--secondary);
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
@media (max-width: 768px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

.file-drop-area {
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(102, 252, 241, 0.02);
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}
.file-drop-area:hover {
    background: rgba(102, 252, 241, 0.05);
}
.file-drop-area p { color: var(--secondary); margin-top: 10px;}
.file-drop-area input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.drop-icon {
    font-size: 2.5rem;
}

.result-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    text-align: center;
}
.empty-state {
    color: var(--secondary);
}

#result-image {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    max-height: 500px;
    object-fit: contain;
}
.time-label {
    display: block;
    color: var(--secondary);
    font-size: 0.85rem;
}

/* SPINNER */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(102, 252, 241, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 15px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* TERMINAL LOG */
.terminal-log {
    margin-top: 30px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    max-height: 250px;
    display: flex;
    flex-direction: column;
}
.terminal-header {
    background: #222;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    font-size: 0.85rem;
    color: #888;
}
.terminal-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #4af626;
    line-height: 1.4;
}
.terminal-content .log-entry { margin-bottom: 4px; }
.terminal-content .log-system { color: #888; }
.terminal-content .log-progress { color: #66fcf1; }
.terminal-content .log-error { color: #f25f5c; }
.btn-small { background: transparent; border: 1px solid #555; color: #ccc; border-radius: 4px; cursor: pointer; padding: 2px 8px; font-size: 0.75rem; }
.btn-small:hover { background: #333; color: #fff; }

/* --- VIP & ADMIN STYLES --- */
.vip-tool { position: relative; overflow: hidden; }
.lock-overlay {
    position: absolute; top:0; left:0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    color: #e74c3c; font-weight: bold; font-size: 1.2rem;
    z-index: 10; display: none; /* toggled by JS */
}

/* Admin Layout */
.admin-layout { display: flex; gap: 20px; margin-top: 20px; align-items: flex-start;}
.admin-sidebar { width: 250px; padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.admin-sidebar h2 { font-size: 1.2rem; margin-top:0; margin-bottom: 5px; color: #f39c12; }
.admin-nav { display: flex; flex-direction: column; gap: 8px; }
.admin-nav a { padding: 10px 15px; text-decoration: none; color: #a4b2c1; border-radius: 6px; transition: all 0.2s; background: rgba(255,255,255,0.03); }
.admin-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-nav a.active { background: #2c974b; color: white; border-left: 4px solid #fff; }
.admin-content { flex: 1; min-width: 0; }

.admin-form-group { margin-bottom: 20px; }
.admin-form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #ccc; }
.admin-form-group input, .admin-form-group select, .admin-form-group textarea {
    width: 100%; padding: 12px; background: rgba(0,0,0,0.3); border: 1px solid #333;
    border-radius: 6px; color: #fff;
}
.app-config-card { background: rgba(255,255,255,0.02); border: 1px solid #333; padding: 15px; border-radius: 8px; margin-bottom: 15px; }
.app-config-card h4 { margin-top:0; color: #66fcf1; }

.user-table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 0.9rem; }
.user-table th, .user-table td { padding: 10px; border-bottom: 1px solid #333; text-align: left; }
.user-table th { color: #a4b2c1; }
.badge-admin { background: #f39c12; color: #000; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: bold;}
.badge-vip { background: #e74c3c; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: bold;}

/* ============================================ */
/* ARCHITECTURAL WORKFLOWS SECTION              */
/* ============================================ */
.arch-phase-group {
    margin-bottom: 30px;
}

.phase-title {
    font-size: 1.1rem;
    color: var(--primary);
    padding-bottom: 8px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(102, 252, 241, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}

.phase-badge {
    background: rgba(102, 252, 241, 0.1);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.arch-sub-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.arch-tool-card {
    padding: 1.2rem !important;
    transition: all 0.3s ease;
}
.arch-tool-card .icon {
    font-size: 2rem;
    margin-bottom: 10px;
}
.arch-tool-card h3 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}
.arch-tool-card .cost {
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    padding: 3px 8px;
}

.arch-type-hint {
    font-size: 0.8rem !important;
    color: #777 !important;
    margin-bottom: 5px !important;
}

.arch-preview-img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 12px;
    max-height: 200px;
    object-fit: contain;
    border: 1px solid var(--border);
}

/* Select/Dropdown styling */
select {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: 0.3s;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366fcf1' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(102,252,241,0.3);
}
select option {
    background: #1f2833;
    color: #fff;
}

/* Textarea in tool views */
.tool-container textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: 0.3s;
    resize: vertical;
}
.tool-container textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(102,252,241,0.3);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .arch-sub-grid {
        grid-template-columns: 1fr;
    }
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
    }
}

