/* ===========================
   ESTILOS RESPONSIVE
   Web y Móvil
   =========================== */

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

:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --secondary-color: #6c757d;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.user-phone {
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    box-shadow: var(--shadow);
}

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

.btn-success:hover {
    background-color: #218838;
}

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

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 60px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-container p {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 14px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.card-subtitle {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 5px;
}

.card-body {
    font-size: 14px;
}

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

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #f57c00;
    color: #fff;
    font-weight: 600;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: var(--light-bg);
}

/* Listas */
.list-group {
    list-style: none;
}

.list-group-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    margin-bottom: 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.list-group-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.list-group-item:last-child {
    border-bottom: 1px solid var(--border-color);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.list-group-item:hover {
    background-color: var(--light-bg);
}

.list-item-pos {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.position-badge {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.position-info {
    flex: 1;
}

.position-name {
    font-weight: 600;
    display: block;
}

.position-phone {
    font-size: 12px;
    color: var(--secondary-color);
    display: block;
}

.position-score {
    font-size: 12px;
    color: #856404;
    font-weight: 600;
    display: block;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
}

.spinner {
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Grid Responsivo */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.col {
    min-width: 0;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .login-container {
        margin: 40px auto;
        padding: 25px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .card {
        padding: 15px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .position-name,
    .position-phone,
    .position-score {
        font-size: 11px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .list-group-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .position-info {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .login-container {
        margin: 20px auto;
        padding: 15px;
    }

    .logo {
        font-size: 20px;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .card {
        padding: 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select {
        padding: 10px;
        font-size: 16px;
    }

    table {
        font-size: 11px;
    }

    th, td {
        padding: 6px;
    }

    .position-badge {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-title {
        font-size: 16px;
    }
}

/* Utilities */
.mt {
    margin-top: 20px;
}

.mb {
    margin-bottom: 20px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--secondary-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-success {
    color: var(--success-color);
}

.d-none {
    display: none !important;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap {
    gap: 10px;
}

/* ===========================
   USER CURRENT INDICATOR
   =========================== */

.you-indicator {
    display: inline-block;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.list-group-item.your-inscription {
    background: linear-gradient(135deg, #f8f9ff, #e3f2fd);
    border-left: 4px solid #007bff;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.list-group-item.your-inscription::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #007bff, #0056b3);
    border-radius: 0 2px 2px 0;
}

/* Highlight del nombre del usuario actual */
.list-group-item.your-inscription .position-name {
    font-weight: 600;
    color: #0056b3;
}

/* Score con emoji actualizado */
.position-score {
    font-weight: 500;
    color: #6c757d;
}

/* ===========================
   HORIZONTAL LIST LAYOUT
   =========================== */

.list-item-horizontal {
    display: flex;
    align-items: center;
    padding: 12px 20px !important;
    min-height: 52px !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: white;
    border: 1px solid #e9ecef;
    margin-bottom: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.list-item-horizontal:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.pos-badge {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    font-weight: 700;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    margin-right: 2px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.pos-name {
    font-weight: 600;
    color: #212529;
    font-size: 15px;
    flex: 2.5;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 16px;
    line-height: 1.4;
}

.pos-name-small {
    font-weight: 600;
    color: #212529;
    font-size: 13px;
    flex: 2.5;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.pos-phone {
    font-size: 13px;
    color: #495057;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 500;
    flex: 1.2;
    min-width: 120px;
    text-align: center;
    background: #f1f3f4;
    padding: 8px 12px;
    border-radius: 6px;
    margin-right: 16px;
    letter-spacing: 0.5px;
    border: 1px solid #e9ecef;
}

.pos-score {
    font-size: 12px;
    font-weight: 600;
    color: #6c4400;
    background: linear-gradient(135deg, #fff3cd, #ffe8a1);
    padding: 8px 12px;
    border-radius: 16px;
    flex-shrink: 0;
    white-space: nowrap;
    border: 1px solid #ffd700;
    min-width: 75px;
    text-align: center;
    margin-right: 12px;
    box-shadow: 0 1px 3px rgba(255, 215, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.pos-actions {
    flex-shrink: 0;
    margin-left: auto;
}

.pos-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid currentColor;
}

.pos-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.25);
}

/* Botón de eliminar (X) pequeño */
.btn-icon-delete {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.btn-icon-delete:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
}

.btn-icon-delete:active {
    transform: scale(0.95);
}

/* Ajustes para usuario actual en layout horizontal */
.list-item-horizontal.your-inscription {
    background: linear-gradient(135deg, #f0fff4, #e6fffa);
    border: 2px solid #28a745;
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.2);
}

.list-item-horizontal.your-inscription:hover {
    background: linear-gradient(135deg, #e6fffa, #d4edda);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
}

.list-item-horizontal.your-inscription .pos-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.list-item-horizontal.your-inscription .pos-name {
    color: #155724;
    font-weight: 700;
}

.list-item-horizontal.your-inscription .pos-phone {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    font-weight: 600;
}

.list-item-horizontal.your-inscription .pos-score {
    background: linear-gradient(135deg, #cce5ff, #b3d9ff);
    color: #004085;
    border: 1px solid #0066cc;
}

/* Responsive para móviles - MANTENER TODO HORIZONTAL */
@media (max-width: 768px) {
    .list-item-horizontal {
        padding: 8px 10px !important;
        min-height: 42px !important;
        margin-bottom: 2px;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }

    .pos-badge {
        width: 26px;
        height: 26px;
        font-size: 11px;
        margin-right: 6px;
    }

    .pos-name,
    .pos-name-small {
        font-size: 14px;
        flex: 2;
        margin-right: 6px;
    }

    .pos-score {
        font-size: 12px;
        padding: 4px 6px;
        min-width: 50px;
        margin-right: 6px;
        flex-shrink: 0;
    }

    .btn-icon-delete {
        width: 22px;
        height: 22px;
        font-size: 14px;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .list-item-horizontal {
        padding: 6px 6px !important;
        min-height: 38px !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }

    .pos-badge {
        width: 22px;
        height: 22px;
        font-size: 9px;
        margin-right: 4px;
    }

    .pos-name,
    .pos-name-small {
        font-size: 13px;
        margin-right: 4px;
        flex: 2;
    }

    .pos-score {
        font-size: 11px;
        padding: 3px 4px;
        min-width: 45px;
        margin-right: 4px;
        flex-shrink: 0;
    }

    .btn-icon-delete {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}
