/* D-TECH Design System */
:root {
    --bg-color: #0b0c10;
    --container-bg: #1f2833;
    --text-color: #c5c6c7;
    --primary-accent: #66fcf1;
    --secondary-accent: #45a29e;
    --error-color: #ff4b4b;
    --success-color: #00ff88;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px rgba(102, 252, 241, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.fade-in { animation: fadeIn 0.5s ease forwards; }
.slide-up { animation: slideUp 0.5s ease forwards; }

.hidden { display: none !important; }

/* Premium Header */
.hero-header {
    background: linear-gradient(180deg, rgba(31, 40, 51, 0.8) 0%, var(--bg-color) 100%);
    padding: 40px 20px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(102, 252, 241, 0.2);
    margin-bottom: 30px;
}

.hero-header h1 {
    color: var(--primary-accent);
    margin: 0 0 10px 0;
    font-size: 2.5em;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: var(--shadow-glow);
}

.hero-header p {
    color: var(--text-color);
    font-size: 1.1em;
    margin: 0;
    opacity: 0.9;
}

/* Base Card Layout */
.card {
    background-color: var(--container-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin: 0 20px 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 252, 241, 0.3);
}

.card-title {
    color: var(--primary-accent);
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Floating Labels */
.floating-group {
    position: relative;
    margin-bottom: 15px;
    width: 100%;
}

.floating-input {
    width: 100%;
    padding: 18px 12px 6px;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: #fff;
    transition: var(--transition);
    outline: none;
}

.floating-input:focus,
.floating-input:not(:placeholder-shown) {
    border-color: var(--primary-accent);
    background-color: rgba(0, 0, 0, 0.4);
}

.floating-label {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #888;
    pointer-events: none;
    transition: var(--transition);
    font-size: 16px;
}

.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    top: 4px;
    font-size: 11px;
    color: var(--primary-accent);
}

/* Validation styling */
.floating-input.valid {
    border-color: var(--success-color);
}
.floating-input.invalid {
    border-color: var(--error-color);
}

/* Subject Row Cards */
.subject-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.subject-card:hover {
    background: rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.subject-card-select { flex: 2; min-width: 180px; }
.subject-card-perc { flex: 1; min-width: 100px; }
.subject-card-level { flex: 0.5; min-width: 70px; }
.subject-card-action { flex: 0; }

.subject-card input[readonly] {
    background: transparent;
    border: none;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-accent);
}

/* Custom Select Styling */
select.floating-input {
    appearance: none;
    cursor: pointer;
}
.select-wrapper {
    position: relative;
}
.select-wrapper::after {
    content: "▼";
    font-size: 10px;
    color: var(--primary-accent);
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background-color: transparent;
    color: var(--error-color);
    border: 1px solid rgba(255, 75, 75, 0.3);
    padding: 10px;
}
.btn-danger:hover {
    background-color: rgba(255, 75, 75, 0.1);
    border-color: var(--error-color);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
}

.btn-outline:hover {
    background-color: rgba(102, 252, 241, 0.1);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Inline Icons (SVG placeholders via background or inline html) */
.icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Dashboard Gauges */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(0,0,0,0.2);
    border-radius: var(--border-radius-sm);
    padding: 20px 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-accent);
    display: block;
}

.gauge-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
}
.gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.gauge-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 8;
}
.gauge-progress {
    fill: none;
    stroke: var(--primary-accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out, stroke 1s ease-out;
}
.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    transition: color 1s ease-out;
}

.dashboard-footer {
    font-size: 0.85em;
    color: #666;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* University Grid */
.uni-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .uni-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}
@media (min-width: 1024px) {
    .uni-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.uni-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.uni-card:hover {
    background: rgba(102, 252, 241, 0.05);
    border-color: var(--primary-accent);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    color: var(--primary-accent);
}

/* Recommendation Cards */
.rec-tier {
    margin-bottom: 25px;
}

.rec-tier-header {
    background: rgba(102, 252, 241, 0.1);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    color: var(--primary-accent);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-accent);
    margin-bottom: 10px;
    transition: var(--transition);
}
.rec-tier-header:hover {
    background: rgba(102, 252, 241, 0.15);
}

.rec-tier-content {
    display: none;
    padding: 10px 0;
}
.rec-tier-content.open {
    display: block;
    animation: slideUp 0.3s ease;
}

.rec-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.rec-info h4 {
    margin: 0 0 5px 0;
    color: #fff;
}
.rec-info p {
    margin: 0;
    font-size: 0.9em;
    color: #aaa;
}

.rec-badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    white-space: nowrap;
}
.badge-100 { background: rgba(0, 255, 136, 0.1); color: var(--success-color); border: 1px solid var(--success-color); }
.badge-high { background: rgba(162, 255, 0, 0.1); color: #a2ff00; border: 1px solid #a2ff00; }
.badge-med { background: rgba(255, 170, 0, 0.1); color: #ffaa00; border: 1px solid #ffaa00; }
.badge-low { background: rgba(255, 75, 75, 0.1); color: var(--error-color); border: 1px solid var(--error-color); }

/* Loaders */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 252, 241, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-accent);
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}
.loader-text {
    text-align: center;
    color: var(--primary-accent);
    font-weight: bold;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}
.modal-content {
    background: var(--container-bg);
    border: 1px solid rgba(102, 252, 241, 0.3);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease;
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1.5em;
    cursor: pointer;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--error-color);
}

/* Data Tables (Breakdowns) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
}
.data-table th, .data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: left;
}
.data-table th {
    background: rgba(0,0,0,0.3);
    color: var(--primary-accent);
    font-weight: bold;
}
.data-table tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .subject-card { flex-direction: column; align-items: stretch; gap: 10px; }
    .btn { width: 100%; justify-content: center; }
    .actions-row { flex-direction: column; gap: 10px; }
    .rec-card { flex-direction: column; text-align: center; }
    .card { padding: 15px; margin: 0 10px 20px; }
}
