/* =====================
   BASE SHARED STYLES
   ===================== */

:root {
    --primary: #3498db;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --background-dark: #1a1a1a;
    --background-light: #ffffff;
    --text-dark: #ffffff;
    --text-light: #333333;
    --radius: 12px;
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --background: var(--background-dark);
    --text: var(--text-dark);
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border: #404040;
    --card-hover: #353535;
}
[data-theme="light"] {
    --background: var(--background-light);
    --text: var(--text-light);
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border: #e0e0e0;
    --card-hover: #f5f5f5;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 0;
}

/* =====================
   NAVIGATION & BUTTONS
   ===================== */

.back-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.back-link:hover {
    background: #217dbb;
    color: #fff;
    text-decoration: underline;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.button, button, input[type="submit"], .btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.button:hover, button:hover, input[type="submit"]:hover, .btn:hover {
    background: #217dbb;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* =====================
   FORMS & INPUTS
   ===================== */

input[type="text"], input[type="password"], input[type="email"], select, textarea {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border, #ccc);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    margin-bottom: 1rem;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-hover);
}
label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =====================
   CARD & CONTAINER
   ===================== */

.card, .container, .reset-container {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

/* =====================
   THEME SWITCH
   ===================== */
.theme-switch-wrapper {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}
.theme-switch {
    display: inline-block;
    height: 60px;
    position: relative;
    width: 30px;
}
.theme-switch input {
    display: none;
}
.switch {
    background: var(--bg-secondary);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 4px;
}
.switch-handle {
    bottom: 4px;
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 22px;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
input:checked + .switch .switch-handle {
    transform: translateY(-26px);
}
.switch:before, .switch:after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 10px;
    border-radius: 2px;
}
.switch:before {
    top: 5px;
}
.switch:after {
    bottom: 5px;
}

/* =====================
   TABLES
   ===================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    font-weight: bold;
}

/* =====================
   MISC
   ===================== */
pre {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}
[data-theme="light"] pre {
    background-color: #f0f0f0;
    border-color: #d0d0d0;
    color: #333;
}

.error-message {
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--danger);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 1rem;
    text-align: center;
}
.success-message {
    color: var(--success);
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid var(--success);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 1rem;
    text-align: center;
}

::-webkit-scrollbar {
    width: 8px;
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

