/* Shared styles for the login system */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --input-bg: #2c2c2c;
    --input-border: #333;
    --primary-color: #bb86fc;
    --primary-hover: #9955d4;
    --error-color: #cf6679;
    --toast-bg: #333;
    --toast-text: #fff;
}

body.light-mode {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --input-bg: #f9f9f9;
    --input-border: #ddd;
    --primary-color: #6200ee;
    --primary-hover: #3700b3;
    --error-color: #b00020;
    --toast-bg: #fff;
    --toast-text: #333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Permite crescer além da tela */
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    overflow-y: auto; /* Garante scroll */
}

.container {
    width: 100%;
    /* max-width: 400px;  <-- Removido para permitir expansão */
    padding: 20px;
    position: relative;
    box-sizing: border-box; /* Garante que padding não estoure a largura */
}

.form-box {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 400px;
    margin: 20px auto; /* Centraliza */
    text-align: center;
    transition: background-color 0.3s, box-shadow 0.3s;
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

/* Telas mais largas */
.form-box.wide-content {
    max-width: 800px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    width: 100%;
    margin: 10px 0;
}

input {
    width: 100%;
    padding: 14px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text-color);
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.3s;
}

.input-wrapper input {
    margin: 0;
    padding-right: 40px;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    margin: 0;
    width: auto;
    display: flex;
    align-items: center;
    opacity: 0.6;
}

.toggle-password:hover {
    opacity: 1;
}

button.primary-btn {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

button.primary-btn:hover {
    background-color: var(--primary-hover);
}

button.primary-btn:active {
    transform: scale(0.98);
}

.links {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

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

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

.hidden {
    display: none !important;
}

p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Toast Notification */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--toast-bg);
    color: var(--toast-text);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 250px;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    border-left: 4px solid #4CAF50;
}

.toast.error {
    border-left-color: var(--error-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    transition: all 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100%;
    background: #111;
    border-right: 1px solid #222;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0,0,0,0.5);
}

.sidebar.hidden {
    transform: translateX(-100%);
    display: flex !important; /* Override generic hidden for sidebar animation */
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, #111, #161616);
}

.sidebar-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.close-sidebar-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    display: none; /* Only show on mobile */
}

.sidebar-nav {
    list-style: none;
    padding: 20px 10px;
    margin: 0;
    overflow-y: auto;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #aaa;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav a svg {
    margin-right: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
}

.sidebar-nav a:hover svg {
    opacity: 1;
}

.hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 999;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.hamburger-btn:hover {
    background: #333;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 300px;
    }
    .close-sidebar-btn {
        display: block;
    }
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.plan-card {
    background: #222;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.plan-card:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    background: #2a2a2a;
}

.plan-card.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
}

.plan-days {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.plan-price {
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Payment List */
.payment-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.payment-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.payment-icon-wrapper {
    width: 40px;
    height: 40px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4CAF50;
}

.payment-details {
    flex: 1;
}

.payment-plan-name {
    color: #fff;
    font-weight: 600;
    margin-bottom: 4px;
}

.payment-date {
    color: #888;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.payment-amount {
    font-weight: bold;
    color: #fff;
    font-size: 1.1rem;
}

.payment-status-badge {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

/* Group List Styling - Enhanced */
#groups-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    padding: 5px;
}

.group-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.group-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.group-item.selected {
    background: rgba(229, 9, 20, 0.15);
    border-color: #e50914;
}

.group-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #e50914;
    cursor: pointer;
    flex-shrink: 0;
}

.group-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #333, #444);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    border: 2px solid #555;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.group-info {
    flex: 1;
    min-width: 0; /* for text-overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.group-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    display: block;
}

.group-meta {
    color: #888;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
