/* ============================================
   AI StudyHub - Base Styles & Reset
   ============================================ */

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

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    transition: background var(--transition-normal), color var(--transition-normal);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* Links */
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-light); }

/* Headings */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}
.btn .material-icons { font-size: 18px; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md), var(--shadow-glow); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

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

.btn-sm { padding: 6px 12px; font-size: var(--font-size-xs); }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-icon.btn-sm .material-icons { font-size: 18px; }
.btn-icon.btn-primary { background: var(--gradient-primary); color: white; }
.btn-icon.btn-primary:hover { box-shadow: var(--shadow-glow); }

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

/* Form Groups */
.form-group {
    position: relative;
    margin-bottom: var(--space-md);
    flex: 1;
}
.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}
.form-row { display: flex; gap: var(--space-md); }

/* Glass Card */
.glass-card {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Hidden */
.hidden { display: none !important; }

/* Text utilities */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--text-tertiary);
    text-align: center;
    gap: var(--space-sm);
}
.empty-state .material-icons { font-size: 48px; opacity: 0.5; }
.empty-state.small { padding: var(--space-lg); }
.empty-state.small .material-icons { font-size: 32px; }

/* Kbd */
kbd {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.4;
}

/* Color Picker */
.color-picker {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    background: none;
}
.color-picker::-webkit-color-swatch-wrapper { padding: 2px; }
.color-picker::-webkit-color-swatch { border: none; border-radius: var(--radius-sm); }

/* Size Select */
.size-select {
    width: auto;
    padding: 4px 8px;
    font-size: var(--font-size-xs);
}

/* Tool Divider */
.tool-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 var(--space-sm);
}
