/* Основные стили с префиксом ac */
.ac-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

/* Часы */
.ac-clock-section {
    text-align: center;
    margin-bottom: 30px;
}

.ac-clock {
    font-size: 4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.ac-date {
    font-size: 1.5rem;
    color: #666;
}

/* Кнопки предустановленного времени */
.ac-preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.ac-time-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
}

.ac-time-btn:hover {
    background: #e9e9e9;
}

.ac-time-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Кастомный будильник */
.ac-custom-alarm-section {
    text-align: center;
    margin-bottom: 30px;
}

.ac-custom-alarm-btn {
    padding: 12px 24px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    min-height: 44px;
}

/* Модальное окно */
.ac-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.ac-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.ac-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.ac-time-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.ac-time-input {
    width: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1.2rem;
    text-align: center;
}

.ac-sound-selection {
    margin: 20px 0;
}

.ac-sound-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.ac-set-custom-alarm {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    min-height: 44px;
}

/* Активные будильники */
.ac-active-alarms {
    margin-bottom: 30px;
}

.ac-alarms-list {
    margin: 15px 0;
}

.ac-alarm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 5px;
    margin: 5px 0;
}

.ac-alarm-time {
    font-weight: bold;
}

.ac-alarm-sound {
    color: #666;
    font-size: 0.9rem;
}

.ac-delete-alarm {
    background: #ff4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}

.ac-clear-all {
    width: 100%;
    padding: 10px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    min-height: 44px;
}

/* Блок поделиться */
.ac-share-section {
    text-align: center;
    margin-top: 30px;
}

.ac-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.ac-share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    min-height: 50px;
    min-width: 50px;
}

.ac-share-btn:hover {
    transform: scale(1.1);
}

.ac-vk { background: #4a76a8; color: white; }
.ac-tg { background: #0088cc; color: white; }
.ac-wa { background: #25D366; color: white; }
.ac-link { 
    background: #666; 
    color: white; 
    position: relative;
}

/* Стили для тултипа кнопки ссылки */
.ac-link:hover::after {
    content: 'Копировать ссылку';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.ac-link:hover::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #333;
}

/* Полноэкранное уведомление будильника */
.ac-fullscreen-alarm {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    text-align: center;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ac-fullscreen-alarm.active {
    display: flex;
    animation: ac-alarm-pulse 1s infinite;
}

.ac-alarm-time-display {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.ac-alarm-message {
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.ac-stop-alarm {
    padding: 15px 30px;
    font-size: 1.5rem;
    background: white;
    color: #ff6b6b;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    touch-action: manipulation;
    min-height: 60px;
    -webkit-appearance: none;
}

.ac-stop-alarm:hover,
.ac-stop-alarm:active {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Кнопка разблокировки аудио для iOS */
#acUnlockAudio {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    z-index: 10002;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    min-height: 44px;
    display: none;
}

#acUnlockAudio:hover {
    background: #ff5252;
}

/* Анимация пульсации */
@keyframes ac-alarm-pulse {
    0% { 
        background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
        transform: scale(1);
    }
    50% { 
        background: linear-gradient(135deg, #ff5252, #ff6b6b);
        transform: scale(1.02);
    }
    100% { 
        background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
        transform: scale(1);
    }
}

/* Уведомление */
.ac-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2196F3;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-weight: bold;
    text-align: center;
    min-width: 300px;
    max-width: 90%;
}

/* Специальный стиль для уведомления о копировании ссылки */
.ac-notification.link-copied {
    background: #4CAF50 !important;
    border: 2px solid #45a049 !important;
    color: white !important;
}

/* Уведомление для iOS */
.ac-ios-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.4;
    display: none;
}

/* iOS специфичные стили */
@supports (-webkit-touch-callout: none) {
    .ac-container {
        -webkit-touch-callout: none;
    }
    
    .ac-time-input {
        font-size: 16px; /* Предотвращает zoom в iOS */
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .ac-clock {
        font-size: 3rem;
    }
    
    .ac-date {
        font-size: 1.2rem;
    }
    
    .ac-time-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .ac-preset-buttons {
        gap: 5px;
    }
    
    .ac-share-buttons {
        gap: 10px;
    }
    
    .ac-share-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .ac-alarm-time-display {
        font-size: 3rem;
    }
    
    .ac-alarm-message {
        font-size: 1.5rem;
    }
    
    .ac-stop-alarm {
        font-size: 1.2rem;
        padding: 12px 24px;
    }
    
    #acUnlockAudio {
        bottom: 10px;
        right: 10px;
        padding: 12px 16px;
        font-size: 11px;
    }
    
    .ac-fullscreen-alarm {
        padding: 20px;
    }
    
    .ac-notification {
        min-width: 250px;
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ac-container {
        padding: 10px;
    }
    
    .ac-clock {
        font-size: 2.5rem;
    }
    
    .ac-date {
        font-size: 1rem;
    }
    
    .ac-time-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .ac-alarm-time-display {
        font-size: 2.5rem;
    }
    
    .ac-alarm-message {
        font-size: 1.2rem;
        margin-bottom: 40px;
    }
    
    .ac-stop-alarm {
        font-size: 1rem;
        padding: 15px 30px;
    }
    
    .ac-modal-content {
        margin: 10% auto;
        padding: 15px;
    }
    
    .ac-share-buttons {
        gap: 8px;
    }
    
    .ac-share-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .ac-notification {
        min-width: 200px;
        padding: 10px 15px;
        font-size: 13px;
    }
}