/* RosterHub Styles - Matching Power Soccer Play Editor Design System */

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html, body { 
    height: 100%; 
    font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    background: 
        linear-gradient(180deg, #8BB8E8 0%, #4a7fb8 8%, #2a4f88 12%, #000000 20%, #000000 100%),
        radial-gradient(circle at 30% 5%, rgba(139, 184, 232, 0.4) 0%, transparent 25%),
        radial-gradient(circle at 70% 5%, rgba(139, 184, 232, 0.3) 0%, transparent 25%);
    background-attachment: fixed;
    color: #fff;
    overflow-x: hidden;
}

.main-wrapper {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    width: 100%;
    max-width: 1200px;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(139, 184, 232, 0.1) 0%, rgba(74, 127, 184, 0.05) 15%, rgba(0, 0, 0, 0.4) 25%, rgba(0, 0, 0, 0.6) 100%);
    border: 1px solid rgba(139, 184, 232, 0.3);
    border-radius: 32px;
    padding: 32px;
    backdrop-filter: blur(15px);
    box-shadow: 
        0 16px 64px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(139, 184, 232, 0.1),
        inset 0 2px 0 rgba(139, 184, 232, 0.1);
}

/* Header */
.header {
    text-align: center;
    padding: 15px 0 20px 0;
    border-bottom: 1px solid rgba(139, 184, 232, 0.1);
    margin-bottom: 30px;
}

.header-logo {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px auto;
    display: block;
    border-radius: 12px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(139, 184, 232, 0.2);
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #8BB8E8, #D3D5D7, #8BB8E8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(139, 184, 232, 0.3);
}

.header .subtitle {
    font-size: 0.9rem;
    color: #cfd6e4;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Auth Section */
.auth-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.auth-card {
    max-width: 400px;
    text-align: center;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(66, 74, 82, 0.6), rgba(134, 38, 51, 0.2));
    border: 1px solid rgba(139, 184, 232, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-actions {
    display: flex;
    gap: 12px;
}

.top-actions button {
    padding: 10px 20px;
    font-size: 13px;
    min-width: auto;
}

#user-name {
    font-weight: 500;
    color: #D3D5D7;
}

/* Filter Section */
.filter-section {
    padding: 20px 24px;
    margin-bottom: 20px;
    background: rgba(66, 74, 82, 0.3);
    border: 1px solid rgba(139, 184, 232, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
}

.team-filter-select {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(139, 184, 232, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: #D3D5D7;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    cursor: pointer;
    min-width: 300px;
}

.team-filter-select:focus {
    outline: none;
    border-color: #8BB8E8;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(139, 184, 232, 0.1);
}

.team-filter-select option {
    background: #2a4f88;
    color: #fff;
}

/* Roster Table Container */
.roster-table-container {
    background: rgba(66, 74, 82, 0.3);
    border: 1px solid rgba(139, 184, 232, 0.2);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
    overflow-x: auto;
}

/* Simple Roster Table */
.simple-roster-table {
    width: 100%;
    border-collapse: collapse;
}

.simple-roster-table thead {
    background: rgba(139, 184, 232, 0.15);
    border-bottom: 2px solid rgba(139, 184, 232, 0.3);
}

.simple-roster-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #8BB8E8;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.simple-roster-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(139, 184, 232, 0.1);
    color: #D3D5D7;
    font-size: 14px;
}

.simple-roster-table tbody tr {
    transition: background 0.2s ease;
}

.simple-roster-table tbody tr:hover {
    background: rgba(139, 184, 232, 0.05);
}

.simple-roster-table tbody tr:last-child td {
    border-bottom: none;
}

/* Editable fields */
.editable-field {
    background: rgba(139, 184, 232, 0.1);
    border: 1px solid rgba(139, 184, 232, 0.3);
    padding: 6px 10px;
    border-radius: 4px;
    color: #D3D5D7;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    width: 100%;
    max-width: 120px;
}

.editable-field:focus {
    outline: none;
    border-color: #8BB8E8;
    background: rgba(139, 184, 232, 0.15);
}

.position-fields {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.position-fields input {
    max-width: 100px;
    font-size: 12px;
    padding: 4px 8px;
}

.position-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.position-tag {
    display: inline-block;
    background: rgba(139, 184, 232, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #8BB8E8;
    border: 1px solid rgba(139, 184, 232, 0.3);
}

.edit-mode .simple-roster-table tbody tr {
    background: rgba(139, 184, 232, 0.02);
}

.delete-btn {
    background: rgba(255, 82, 82, 0.2);
    border: 1px solid rgba(255, 82, 82, 0.4);
    color: #ff5252;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: rgba(255, 82, 82, 0.3);
    border-color: rgba(255, 82, 82, 0.6);
}

/* Action Button (three dots) */
.action-btn {
    background: rgba(139, 184, 232, 0.2);
    border: 1px solid rgba(139, 184, 232, 0.4);
    color: #8BB8E8;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(139, 184, 232, 0.3);
    border-color: rgba(139, 184, 232, 0.6);
}

/* Context Menu */
.context-menu {
    background: linear-gradient(135deg, rgba(66, 74, 82, 0.98), rgba(134, 38, 51, 0.3));
    border: 2px solid rgba(139, 184, 232, 0.5);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 100000;
    min-width: 180px;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: rgba(139, 184, 232, 0.05);
    border: 1px solid rgba(139, 184, 232, 0.2);
    border-radius: 6px;
    color: #D3D5D7;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.context-menu-item:last-child {
    margin-bottom: 0;
}

.context-menu-item:hover {
    background: rgba(139, 184, 232, 0.15);
    border-color: rgba(139, 184, 232, 0.4);
}

.context-menu-item.danger {
    background: rgba(255, 82, 82, 0.1);
    border-color: rgba(255, 82, 82, 0.3);
    color: #ff5252;
}

.context-menu-item.danger:hover {
    background: rgba(255, 82, 82, 0.2);
    border-color: rgba(255, 82, 82, 0.5);
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.app-card {
    background: linear-gradient(135deg, rgba(66, 74, 82, 0.9) 0%, rgba(134, 38, 51, 0.3) 50%, rgba(66, 74, 82, 0.8) 100%);
    border: 1px solid rgba(139, 184, 232, 0.3);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(139, 184, 232, 0.1),
        inset 0 1px 0 rgba(211, 213, 215, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.5),
        0 4px 16px rgba(139, 184, 232, 0.2),
        inset 0 1px 0 rgba(211, 213, 215, 0.2);
    border-color: rgba(139, 184, 232, 0.5);
}

.app-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #8BB8E8;
}

.card-description {
    color: #cfd6e4;
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.placeholder-text {
    color: #7a8a9a;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #8BB8E8, #4a7fb8, #2a4f88);
    color: white;
    padding: 14px 28px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 
        0 8px 24px rgba(139, 184, 232, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(211, 213, 215, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(139, 184, 232, 0.5),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(211, 213, 215, 0.3);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: linear-gradient(135deg, #424A52, #D3D5D7);
    color: #2a4f88;
    border: 1px solid rgba(139, 184, 232, 0.4);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(211, 213, 215, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    width: 100%;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(211, 213, 215, 0.3);
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(139, 184, 232, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: #D3D5D7;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.input-field:focus {
    outline: none;
    border-color: #8BB8E8;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(139, 184, 232, 0.1);
}

.input-field option {
    background: #2a4f88;
    color: #fff;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(139, 184, 232, 0.3), rgba(74, 127, 184, 0.2));
    border: 1px solid rgba(139, 184, 232, 0.4);
    color: #8BB8E8;
}

.status-badge.admin {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3), rgba(255, 152, 0, 0.2));
    border-color: rgba(255, 183, 77, 0.5);
    color: #ffb74d;
}

/* Roster Table */
.roster-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.roster-table thead {
    background: rgba(139, 184, 232, 0.1);
    border-bottom: 2px solid rgba(139, 184, 232, 0.3);
}

.roster-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #8BB8E8;
    font-size: 13px;
    text-transform: uppercase;
}

.roster-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(139, 184, 232, 0.1);
    color: #D3D5D7;
    font-size: 14px;
}

.roster-table tbody tr:hover {
    background: rgba(139, 184, 232, 0.05);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 16px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(139, 184, 232, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(139, 184, 232, 0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: #8BB8E8;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: #cfd6e4;
    font-weight: 400;
}

/* Error Message */
.error-message {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 8px;
    color: #ff5252;
    font-size: 13px;
}

/* Modal - inline edit cards */
.edit-panel {
    display: none; /* JS sets to flex when active */
    gap: 20px;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.modal {
    display: none;
    margin: 0;
    flex: 1 1 0;
}

.modal-content {
    background: linear-gradient(135deg, rgba(66, 74, 82, 0.98), rgba(134, 38, 51, 0.4));
    border: 2px solid rgba(139, 184, 232, 0.5);
    border-radius: 16px;
    max-width: 100%;
    width: 100%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 8px 32px rgba(139, 184, 232, 0.4);
    color: #D3D5D7;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(139, 184, 232, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(139, 184, 232, 0.1);
}

.modal-header h2 {
    margin: 0;
    color: #8BB8E8;
    font-size: 1.3rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: #D3D5D7;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
}

.modal-body {
    padding: 20px 24px;
    color: #D3D5D7;
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

@media (min-width: 900px) {
    .modal-body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 24px;
        row-gap: 16px;
    }
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #8BB8E8;
    font-weight: 500;
    font-size: 13px;
}

.logo-upload-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(139, 184, 232, 0.3);
    border-radius: 12px;
    text-align: center;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: 1px solid rgba(139, 184, 232, 0.3);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid rgba(139, 184, 232, 0.1);
    text-align: center;
    color: #7a8a9a;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        border-radius: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .user-info-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

