/* CSS Variables */
:root {
    --bg-color: #000000;
    --secondary-bg: #1e1e1e;
    --accent-color: #7a1cb2; /* Vibrant purple accent */
    --accent-hover: #7a1cb2;
    --text-color: #e0e0e0;
    --light-text: #ccc;
    --border-color: #333;
}

/* Base & Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Futura', 'Roboto', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, legend {
    color: #ffffff;
    margin: 0 0 10px;
}

p {
    margin: 15px 0;
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Buttons */
button,
.subscribe-btn {
    padding: 10px 15px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}

button:hover,
.subscribe-btn:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 3px 6px rgba(138, 43, 226, 0.4);
    transform: translateY(-2px);
}

button.dice-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    margin-left: 0.5em;
    font-size: 1em;
    border-radius: 4px;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    background: var(--secondary-bg);
    color: var(--light-text);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* Utility Classes */
.error {
    color: #ff5252;
    margin-bottom: 15px;
}

.success {
    color: #4caf50;
    margin-bottom: 15px;
}

/* Containers */
.container,
.app-container {
    margin: 0 auto;
    padding: 20px;
}

.app-container {
    min-width: 1024px;
}

.container {
    max-width: 500px;
}

/* Header & Account Bar */
.auth-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.about-link,
.pricing-link,
.user-email,
.user-subscription,
.account-link,
.register-link,
.login-link {
    margin-right: 15px;
    color: var(--light-text);
}

.login-link,
.logout-link,
.register-link {
    color: var(--accent-color);
}

/* User info and OAuth styling */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.user-name {
    font-weight: bold;
    color: var(--text-color);
}

.oauth-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 14px;
}

.oauth-google {
    background-color: #4285f4;
}

/* Lists & Cards */
ul {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

li {
    position: relative;
    padding: 10px 10px 10px 30px;
    margin-bottom: 10px;
    background: var(--secondary-bg);
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
    font-size: 0.95em;
}

li:before {
    content: "✓";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    font-weight: bold;
}

.subscription-card,
.account-section {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.subscription-title {
    font-size: 1.6em;
    margin-bottom: 10px;
}

.nav-links {
    margin-top: 30px;
}

/* Panels, Fieldsets & Tables */
.panel,
fieldset {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    padding: 0 10px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.settings-table label {
    margin: 0;
}

.settings-table td {
    border: none;
    text-align: right;
    padding: 8px;
}

/* Pricing Grid */
.pricing-page-container {
    max-width: 900px;
    margin: 40px auto;
    text-align: center;
    padding: 0 20px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.pricing-grid > * {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pro-plan {
    border-color: var(--accent-color);
}

.plan-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.plan-details {
    flex-grow: 1;
}

.plan-footer {
    margin-top: 24px;
}

/* Tabs & Nested Tabs */
.tabs,
.nested-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
}

.tab,
.nested-tab {
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.tab:hover,
.nested-tab:hover {
    background: #222;
}

.tab.active {
    border-bottom: 3px solid var(--accent-color);
    font-weight: 600;
}

.nested-tab.active {
    border-bottom: 2px solid var(--accent-color);
    font-weight: 600;
}

.flex-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    overflow-x: auto;
}

.flex-col {
    flex: 1 0 auto;
    white-space: nowrap;
}

/* MIDI Files Section */
.bundles-section,
.midi-files-section {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.bundle-file-item,
.midi-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    margin-bottom: 10px;
    padding: 10px 20px;
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
    transition: background 0.3s;
}

.bundle-file-item:hover,
.midi-file-item:hover {
    background: #2a2a2a;
}

.bundle-download-link,
.midi-download-link {
    padding: 6px 12px;
    background: #222;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    color: var(--accent-color);
    transition: background 0.3s;
}

.bundle-download-link:hover,
.midi-download-link:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Controls & Music */
.controls-container {
    background: #111111;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.music-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.slider-container {
    width: 100%;
    margin-bottom: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
}

/* Toast Notification */
#toast {
    visibility: hidden;
    min-width: 250px;
    background: var(--accent-color);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 999;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 1em;
    transition: opacity 0.5s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {
        opacity: 0;
        bottom: 0;
    }
    to {
        opacity: 1;
        bottom: 30px;
    }
}

@keyframes fadeout {
    from {
        opacity: 1;
        bottom: 30px;
    }
    to {
        opacity: 0;
        bottom: 0;
    }
}

/* Vue Specific */
[v-cloak] {
    display: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-active {
    background: #4caf50;
    color: #fff;
}

.badge-paused {
    background: #ffc107;
    color: #000;
}

.badge-cancelled {
    background: #f44336;
    color: #fff;
}

.badge-trialing {
    background: #2196f3;
    color: #fff;
}

.badge-past_due {
    background: #ff9800;
    color: #fff;
}

/* Delete account button styling */
.danger-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.danger-button:hover {
    background-color: #c82333;
}

.secondary-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.secondary-button:hover {
    background-color: #5a6268;
}

.warning {
    color: #dc3545;
    font-weight: bold;
}

/* Hero Section */
.hero-section {
    margin: 0 auto; /* Center the section itself */
    max-width: 800px;
    background: linear-gradient(135deg, #6a0ca2, #8a2be2);
    color: #ffffff;
    padding: 10px 10px;
    text-align: center;
    border-radius: 20px;
    border: 4px solid;
}

.hero-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #fff;
    min-height: 3em; /* Prevent layout shifts */
    display: block;
    width: 100%;
    text-align: center;
}

/* Custom Select - best-effort native styling */
select {
    width: 100%;
    padding: 10px;
    background: var(--secondary-bg);
    color: var(--light-text);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: background 0.3s, border-color 0.3s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
}

select:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* Custom arrow */
select::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent-color);
}

/* Note: Styling <option> hover/selected colors is largely controlled by the OS.
   For full control, consider a custom dropdown plugin. */


/* Range Slider Styling */
/* WebKit */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    margin-top: -6px;
    cursor: pointer;
    transition: background 0.3s;
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--accent-hover);
}

/* Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: background 0.3s;
}

input[type="range"]:hover::-moz-range-thumb {
    background: var(--accent-hover);
}

/* IE */
input[type="range"]::-ms-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

input[type="range"]::-ms-fill-lower {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

input[type="range"]::-ms-fill-upper {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

input[type="range"]::-ms-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: background 0.3s;
}

input[type="range"]:hover::-ms-thumb {
    background: var(--accent-hover);
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--secondary-bg);
    margin-right: 8px;
    transition: background-color 0.3s, border-color 0.3s;
    position: relative;
    cursor: pointer;
}

input[type="checkbox"]:hover {
    border-color: var(--accent-hover);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 3px var(--accent-color);
}

input[type="checkbox"]:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group input {
    flex: 1;
    margin-right: 8px;
}

.shrink-center {
    display: inline-block; /* Shrink to fit its content */
    text-align: center; /* Center text and inline elements inside */
    margin: 0 auto; /* Center the fieldset itself */
    padding: 1em; /* Optional: adjust padding as needed */
    border: 1px solid var(--border-color); /* Optional: style the border */
}

.tabs,
.nested-tabs,
.shrink-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Center all fieldsets */
fieldset {
    margin: 0 auto 20px;
    text-align: center;
    /* Optional: limit the width */
    max-width: 800px;
}

.tabs.settings-tabs {
    display: flex;
    align-items: center;
}

.tabs-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.tabs.settings-tabs button {
    margin-left: 16px; /* optional spacing */
}

.tabs,.nested-tabs {
    margin-bottom: 20px;
}

.tempo-name {
    display: inline-block;
    width: 600px; /* Adjust width as needed */
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}

.fade-out {
    opacity: 0;
    transition: opacity 1s ease-out;
}