/* ===== TIBIA TIMER ===== */

.tt-wrapper {
    max-width: 100%;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 20px;
}

/* ---- Configuración ---- */
.tt-config-row {
    margin-bottom: 16px;
}

.tt-config-row label {
    display: block;
    color: #2c3e50;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-config-row input[type="text"]:not(.tt-time-part):not(.tt-alert-msg-input) {
    height: 55px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    font-size: 17px;
    font-weight: bold;
    color: #34495e;
    outline: none;
    padding: 0 12px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.tt-config-row input[type="text"]:not(.tt-time-part):not(.tt-alert-msg-input):focus {
    border-color: rgba(49,67,226,0.8) !important;
}

/* Fila de añadir alerta */
.tt-alert-msg-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    width: 100%;
}

.tt-alert-msg-row input[type="text"] {
    flex: 1;
    height: 55px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    font-size: 17px;
    font-weight: bold;
    color: #34495e;
    padding: 0 12px;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.tt-alert-msg-row input[type="text"]:focus {
    border-color: rgba(49,67,226,0.8) !important;
}

.tt-alert-error {
    font-size: 13px;
    color: #ef4444;
    margin-top: 6px;
    padding: 15px;
    background: rgba(231,76,60,0.08);
    border-left: 3px solid #3143e2;
    border-radius: 5px;
}

.tt-apply-error {
    font-size: 13px;
    color: #ef4444;
    margin-top: 6px;
    padding: 15px;
    background: rgba(231,76,60,0.08);
    border-left: 3px solid #3143e2;
    border-radius: 5px;
}

/* Lista de alertas */
.tt-alert-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
}

.tt-alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-left: 4px solid #3143e2;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #34495e;
}

/* ---- Botones ---- */
.tt-btn {
    height: 55px;
    padding: 0 20px;
    background: rgba(49,67,226,0.8);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(49,67,226,0.2);
}

.tt-btn:hover:not(:disabled) {
    background: #3143e2;
}

.tt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tt-apply {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 16px;
}

.tt-add-alert {
    height: 55px;
    font-size: 13px;
    padding: 0 14px;
    background: rgba(49,67,226,0.8);
    box-shadow: 0 4px 15px rgba(49,67,226,0.2);
}

.tt-add-alert:hover:not(:disabled) {
    background: #3143e2;
}

.tt-add-alert-full {
    width: 100%;
    margin-top: 8px;
}

.tt-remove-alert {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
    background: #e74c3c;
    box-shadow: none;
    letter-spacing: 0;
}

.tt-remove-alert:hover:not(:disabled) {
    background: #c0392b;
}

/* ---- Display ---- */
.tt-label {
    font-size: 13px;
    font-weight: bold;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.tt-display {
    font-weight: bold;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    font-size: 72px;
    color: #10b981;
    margin: 8px 0;
    transition: color 0.5s ease;
}

.tt-timer-name {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    min-height: 24px;
}

.tt-timer-name:empty {
    display: none;
}

/* ---- Controles ---- */
.tt-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.tt-start {
    background: rgba(49,67,226,0.8);
}

.tt-pause {
    background: rgba(221, 133, 0, 0.8);
    box-shadow: 0 4px 15px rgba(243,156,18,0.2);
}

.tt-pause:hover:not(:disabled) {
    background: #ffba12;
}

.tt-reset {
    background: #636e72;
    box-shadow: none;
}

.tt-reset:hover:not(:disabled) {
    background: #7f8c8d;
}

/* ---- Ciclos ---- */
.tt-cycles {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-cycle-count {
    color: #10b981;
    font-weight: bold;
}

/* ---- Notificación ---- */
.tt-notification {
    width: 100%;
    margin-top: 8px;
    padding: 12px 16px;
    background-color: #dddd;
    border-left: 4px solid #e74c3c;
    border-radius: 5px;
    color: #34495e;
    font-size: 14px;
    font-weight: bold;
    animation: tt-fadein 0.3s ease;
    box-sizing: border-box;
}

/* ---- Utilidades ---- */
.tt-hidden {
    display: none !important;
}

@keyframes tt-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Input hh:mm ---- */
.tt-time-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    overflow: hidden;
    transition: border-color 0.3s ease;
    height: 55px;
}

.tt-full-width {
    width: 100%;
    box-sizing: border-box;
}

.tt-time-input-wrapper:focus-within {
    border-color: rgba(49,67,226,0.8);
}

.tt-time-part {
    flex: 1 !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    font-size: 22px !important;
    font-weight: bold !important;
    color: #34495e !important;
    text-align: center !important;
    outline: none !important;
    padding: 0 !important;
    min-width: 0 !important;
}

.tt-time-part::placeholder {
    color: #bbb;
    font-weight: 400;
}

.tt-time-sep {
    font-size: 26px;
    font-weight: bold;
    color: #3143e2;
    padding: 0 4px;
    user-select: none;
    line-height: 1;
}

/* ---- Selector de sonido ---- */
.tt-sound-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tt-input-sound {
    height: 55px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    font-size: 17px;
    font-weight: bold;
    color: #34495e;
    padding: 0 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
    flex: 1;
}

.tt-input-sound:focus {
    border-color: rgba(49,67,226,0.8);
}

.tt-preview-sound {
    height: 55px;
    font-size: 13px;
    padding: 0 16px;
    background: rgba(49,67,226,0.8);
    box-shadow: 0 4px 15px rgba(49,67,226,0.2);
    letter-spacing: 0.5px;
}

.tt-preview-sound:hover:not(:disabled) {
    background: #3143e2;
}

/* ---- Lista de popups abiertos ---- */
.tt-popup-focus {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
    background: rgba(49,67,226,0.8);
    box-shadow: none;
    letter-spacing: 0;
}

.tt-popup-focus:hover:not(:disabled) {
    background: #3143e2;
}

.tt-popup-close {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
    background: rgba(220, 53, 69, 0.8);
    box-shadow: none;
    letter-spacing: 0;
}

.tt-popup-close:hover:not(:disabled) {
    background: #c82333;
}

.tt-popup-edit {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
    background: rgba(221, 133, 0, 0.8);
    box-shadow: none;
    letter-spacing: 0;
}

.tt-popup-edit:hover:not(:disabled) {
    background: #ffba12;
}

/* ---- Banner modo edición ---- */
.tt-edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(243,156,18,0.12);
    border: 2px solid #f39c12;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 16px;
    gap: 10px;
}

.tt-edit-banner-text {
    font-size: 13px;
    font-weight: bold;
    color: #d68910;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-cancel-edit {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
    background: #e74c3c;
    box-shadow: none;
    letter-spacing: 0;
    flex-shrink: 0;
}

.tt-cancel-edit:hover:not(:disabled) {
    background: #c0392b;
}

/* ---- Dashboard ---- */
.tt-dashboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tt-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.tt-new-timer {
    height: 38px;
    font-size: 17px;
    padding: 0 16px;
    background: rgba(49,67,226,0.8);
    box-shadow:0 4px 15px rgba(49, 67, 226, 0.2);
    letter-spacing: 0.5px;
}

.tt-new-timer:hover:not(:disabled) {
    background: #3143e2;
}

.tt-dashboard-empty {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.tt-dashboard-empty-msg {
    font-size: 15px !important;
    font-weight: bold;
    color: #7f8c8d;
    margin-bottom: 26px !important;
}

.tt-dashboard-empty-hint {
    font-size: 13px;
    color: #aaa;
}

.tt-dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tt-dashboard-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #3143e2;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: tt-fadein 0.3s ease;
}

.tt-dashboard-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tt-dashboard-card-name {
    font-size: 13px;
    font-weight: bold;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-dashboard-card-cycles {
    font-size: 13px;
    color: #2c3e50;
    font-weight: bold;
    text-transform: uppercase;
}

.tt-dashboard-card-time {
    font-size: 52px;
    font-weight: bold;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-align: center;
    transition: color 0.5s ease;
}

.tt-dash-time-ok     { color: #10b981; }
.tt-dash-time-warn   { color: #f39c12; }
.tt-dash-time-danger { color: #e74c3c; }

.tt-dash-paused { opacity: 0.45; }

.tt-dashboard-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tt-dashboard-card-actions .tt-btn {
    flex: 1;
    height: 32px;
    font-size: 12px;
    padding: 0 8px;
    letter-spacing: 0;
    box-shadow: none;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .tt-wrapper {
        padding: 16px;
    }
    .tt-display {
        font-size: 56px;
    }
    .tt-btn {
        font-size: 13px;
    }
}