/* Enhanced card design for remote control */
.remote-control-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.remote-control-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header-professional {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    position: relative;
}

.card-header-professional::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.card-header-professional>* {
    position: relative;
    z-index: 1;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-indicator.disconnected {
    background-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.control-button {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid;
    position: relative;
    /* overflow: hidden; Removed to allow badges to overlap */
}

.control-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.control-button:hover::before {
    left: 100%;
}

/* Control button text colors for proper contrast */
.control-button.btn-outline-primary {
    color: #0d6efd;
}

.control-button.btn-outline-primary:hover:not(:disabled) {
    color: var(--color-primary);
    border-color: var(--color-primary-dark);
}

.control-button.btn-outline-success {
    color: #198754 !important;
}

.control-button.btn-outline-success:hover:not(:disabled) {
    color: #ffffff !important;
}

/* Reset active/focus states on touch devices to prevent sticky background */
.control-button.btn-outline-success:active:not(:disabled),
.control-button.btn-outline-success:focus:not(:disabled),
.control-button.btn-outline-success.active:not(:disabled) {
    color: #ffffff !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.control-button.btn-outline-danger {
    color: #dc3545 !important;
}

.control-button.btn-outline-danger:hover:not(:disabled) {
    color: #ffffff !important;
}

/* Reset active/focus states on touch devices to prevent sticky background */
.control-button.btn-outline-danger:active:not(:disabled),
.control-button.btn-outline-danger:focus:not(:disabled),
.control-button.btn-outline-danger.active:not(:disabled) {
    color: #ffffff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.control-button.btn-success {
    color: #ffffff;
}

.control-button.btn-success:hover:not(:disabled) {
    color: #ffffff;
}

.control-button:disabled,
.control-button[disabled] {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
}

.score-display,
.time-display {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--color-border);
}

.time-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-text);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-button {
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: var(--color-surface);
    color: var(--color-outline-text);
    /* Dark text for white background */
    min-height: 60px;
}

.app-primary-button {
    border: 2px solid;
    border-color: var(--color-outline-border);
    background-color: transparent !important;
    color: var(--color-outline-text);
}

.app-primary-button:disabled,
.app-primary-button[disabled] {
    opacity: var(--opacity-disabled) !important;
    color: var(--color-deactivated-text);
}

.app-primary-button:hover:not(:disabled) {
    color: var(--color-primary) !important;
    border-color: var(--color-primary-dark) !important;
}


.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: var(--color-text-light);
}

.action-button:disabled,
.action-button[disabled] {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: var(--color-text-light)
}

/* Override Bootstrap colors for action buttons to ensure proper contrast */

/* Outline buttons - keep dark text on light backgrounds */
.action-button.btn-outline-primary {
    color: #0d6efd !important;
}

.action-button.btn-outline-primary:hover:not(:disabled) {
    color: #ffffff !important;
}

.action-button.btn-outline-success {
    color: #198754 !important;
}

.action-button.btn-outline-success:hover:not(:disabled) {
    color: #ffffff !important;
}

.action-button.btn-outline-danger {
    color: #dc3545 !important;
}

.action-button.btn-outline-danger:hover:not(:disabled) {
    color: #ffffff !important;
}

.action-button.btn-outline-warning {
    color: #ffc107 !important;
}

.action-button.btn-outline-warning:hover:not(:disabled) {
    color: #000000 !important;
}

.action-button.btn-outline-dark {
    color: #212529 !important;
}

.action-button.btn-outline-dark:hover:not(:disabled) {
    color: #ffffff !important;
}

/* Filled buttons - ensure white text on colored backgrounds */
.action-button.btn-success {
    color: var(--color-outline-text);
    background-color: var(--color-success);
    border: 2px solid;
    border-color: var(--color-success)
}

.action-button.btn-success:hover:not(:disabled) {
    color: #ffffff;
}

.action-button.btn-warning {
    color: var(--color-outline-text);
    border: 2px solid;
    border-color: var(--color-warning)
}

.action-button.btn-warning:hover:not(:disabled) {
    color: var(--color-outline-text);
}

.action-button.btn-danger {
    color: #ffffff !important;
}

.action-button.btn-danger:hover:not(:disabled) {
    color: #ffffff !important;
}

.action-button.btn-primary {
    color: #ffffff !important;
}

.action-button.btn-primary:hover:not(:disabled) {
    color: #ffffff !important;
}

.action-button.btn-info {
    color: #ffffff !important;
}

.action-button.btn-info:hover:not(:disabled) {
    color: #ffffff !important;
}

/* Disabled states for all action buttons */
.action-button.btn-outline-primary:disabled,
.action-button.btn-outline-primary[disabled] {
    color: #6c757d !important;
}

.action-button.btn-outline-success:disabled,
.action-button.btn-outline-success[disabled] {
    color: #6c757d !important;
}

.action-button.btn-outline-danger:disabled,
.action-button.btn-outline-danger[disabled] {
    color: #6c757d !important;
}

.action-button.btn-outline-warning:disabled,
.action-button.btn-outline-warning[disabled] {
    color: #6c757d !important;
}

.action-button.btn-outline-dark:disabled,
.action-button.btn-outline-dark[disabled] {
    color: #6c757d !important;
}

.action-button.btn-success:disabled,
.action-button.btn-success[disabled] {
    color: #000000;
    opacity: var(--opacity-disabled);
}

.action-button.btn-warning:disabled,
.action-button.btn-warning[disabled] {
    color: #000000 !important;
    opacity: var(--opacity-disabled);
}

.action-button.btn-danger:disabled,
.action-button.btn-danger[disabled] {
    color: #ffffff !important;
    opacity: var(--opacity-disabled);
}

.action-button.btn-primary:disabled,
.action-button.btn-primary[disabled] {
    color: #ffffff !important;
    opacity: var(--opacity-disabled);
}

.action-button.btn-info:disabled,
.action-button.btn-info[disabled] {
    color: #ffffff !important;
    opacity: var(--opacity-disabled);
}

.action-button .icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
    /* Color inherits from button text color */
}

.action-button .label {
    font-size: 1rem;
    text-align: center;
}

.navbar-professional {
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
}

.navbar-professional .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.navbar-professional .btn-outline-primary:hover {
    color: #ffffff !important;
    background-color: #0d6efd !important;
}

.navbar-professional .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.navbar-professional .btn-outline-danger:hover {
    color: #ffffff !important;
    background-color: #dc3545 !important;
}

/* Text colors using theme variables */
.app-text-primary {
    color: var(--color-text) !important;
}

.app-text-muted {
    color: var(--color-text-muted) !important;
}

/* Mobile offcanvas buttons */
.offcanvas .btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.offcanvas .btn-outline-primary:hover {
    color: #ffffff !important;
    background-color: #0d6efd !important;
}

.offcanvas .btn-outline-danger {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.offcanvas .btn-outline-danger:hover {
    color: #ffffff !important;
    background-color: #dc3545 !important;
}

/* Dropdown menu items */
.dropdown-menu .dropdown-item {
    color: #212529 !important;
}

.dropdown-menu .dropdown-item:hover {
    color: #ffffff !important;
    background-color: #0d6efd !important;
}

.brand-professional {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Reset focus/active visual state for all action buttons to prevent
   buttons from looking "selected" after a tap on touch devices */
.action-button:focus,
.action-button:focus-visible,
.action-button:active {
    box-shadow: none !important;
    outline: none !important;
}

.action-button.app-primary-button:focus:not(:disabled),
.action-button.app-primary-button:active:not(:disabled) {
    background-color: transparent !important;
    color: var(--color-outline-text) !important;
    border-color: var(--color-outline-border) !important;
}

.action-button.btn-success:focus:not(:disabled),
.action-button.btn-success:active:not(:disabled) {
    background-color: var(--color-success) !important;
    color: var(--color-outline-text) !important;
    border-color: var(--color-success) !important;
}

@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: 1fr;
    }

    .action-button {
        min-height: 50px;
        padding: 0.75rem 1.25rem 0.75rem 1.5rem;
        justify-content: flex-start;
    }

    .action-button .icon {
        font-size: 1.25rem;
        margin-right: 1rem;
        min-width: 1.5rem;
        text-align: center;
    }

    .action-button .label {
        font-size: 1rem;
        text-align: left;
    }

    /* Swap play/pause button before rewind in single-column layout */
    #play-pause-btn {
        order: -1;
    }

    .time-display {
        font-size: 2.5rem;
    }

    .card-header-professional {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .action-grid {
        grid-template-columns: 1fr;
    }

    .score-display {
        padding: 1rem;
    }

    .time-display {
        font-size: 2rem;
    }
}

/* Login Card Style from login.html */
.login-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}