/**
 * Frontend Styles for Count Timer & Stopwatch Pro
 * 
 * Mobile-first responsive design with Light/Dark mode support
 * 
 * @package Count_Timer_Pro
 * @since 1.0.0
 */

/* ====================================
   CSS RESET & BASE STYLES
   ==================================== */
.ctp-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ====================================
   MAIN CONTAINER
   ==================================== */
.ctp-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px 20px;
    font-family: 'Arial', 'Helvetica', sans-serif;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Light Theme (Default) */
.ctp-theme-light {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* Dark Theme */
.ctp-theme-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

/* ====================================
   HEADER SECTION (H2 & H4)
   ==================================== */
.ctp-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

/* H2 - Plugin Title (Center, Colorful, Gradient) */
.ctp-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 10px 0;
    background: linear-gradient(90deg, #ffd700 0%, #ff6b6b 50%, #4ecdc4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

/* H4 - Website Name (Right Aligned) */
.ctp-website {
    font-size: 1.2rem;
    font-weight: 500;
    text-align: right;
    margin: 0;
    opacity: 0.9;
    color: #f0f0f0;
}

.ctp-theme-dark .ctp-website {
    color: #b0b0b0;
}

.ctp-website a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ctp-website a:hover {
    color: #ffd700;
    text-decoration: underline;
}

/* ====================================
   QUOTE SECTION
   ==================================== */
.ctp-quote-section {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.ctp-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin: 0;
    color: #fff;
    line-height: 1.6;
    animation: fadeIn 0.6s ease;
}

.ctp-theme-dark .ctp-quote {
    color: #e0e0e0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====================================
   TIMER DISPLAY (Digital Style)
   ==================================== */
.ctp-timer-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 30px 20px;
    margin: 30px 0;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.3);
}

.ctp-time-units {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    justify-items: center;
}

.ctp-unit {
    text-align: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 10px;
    min-width: 80px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ctp-unit:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.ctp-unit span {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    line-height: 1;
}

.ctp-theme-dark .ctp-unit span {
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.6);
}

.ctp-unit label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

/* ====================================
   PROGRESS BAR
   ==================================== */
.ctp-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}

.ctp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ====================================
   CONTROL BUTTONS
   ==================================== */
.ctp-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 25px 0;
}

.ctp-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ctp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ctp-btn:active {
    transform: translateY(0);
}

/* Button Colors */
.ctp-btn-start {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.ctp-btn-pause {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.ctp-btn-resume {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.ctp-btn-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.ctp-btn-reset {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

/* ====================================
   SETTINGS & TOGGLES
   ==================================== */
.ctp-settings {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.ctp-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.ctp-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(10deg);
}

/* ====================================
   PDF EXPORT SECTION
   ==================================== */
.ctp-pdf-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
}

.ctp-pdf-section h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.ctp-theme-dark .ctp-pdf-section h3 {
    color: #e0e0e0;
}

.ctp-pdf-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.ctp-btn-pdf {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* ====================================
   SOCIAL SHARING SECTION
   ==================================== */
.ctp-share-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
}

.ctp-share-section h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.ctp-theme-dark .ctp-share-section h3 {
    color: #e0e0e0;
}

.ctp-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.ctp-share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctp-share-btn:hover {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Platform-specific colors */
.ctp-share-facebook {
    background: #1877f2;
}

.ctp-share-twitter {
    background: #1da1f2;
}

.ctp-share-linkedin {
    background: #0077b5;
}

.ctp-share-whatsapp {
    background: #25d366;
}

.ctp-share-email {
    background: #ea4335;
}

/* ====================================
   CONFETTI CANVAS
   ==================================== */
.ctp-confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

/* ====================================
   RESPONSIVE DESIGN (Mobile First)
   ==================================== */

/* Tablets (768px and below) */
@media (max-width: 768px) {
    .ctp-container {
        padding: 20px 15px;
        margin: 20px 10px;
    }
    
    .ctp-title {
        font-size: 2rem;
    }
    
    .ctp-website {
        font-size: 1rem;
    }
    
    .ctp-time-units {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .ctp-unit span {
        font-size: 2rem;
    }
    
    .ctp-controls {
        gap: 8px;
    }
    
    .ctp-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    
    .ctp-share-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .ctp-container {
        padding: 15px 10px;
        margin: 15px 5px;
        border-radius: 15px;
    }
    
    .ctp-title {
        font-size: 1.6rem;
    }
    
    .ctp-website {
        font-size: 0.9rem;
    }
    
    .ctp-time-units {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .ctp-unit {
        padding: 10px 8px;
        min-width: 60px;
    }
    
    .ctp-unit span {
        font-size: 1.5rem;
    }
    
    .ctp-unit label {
        font-size: 0.65rem;
    }
    
    .ctp-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .ctp-btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .ctp-pdf-options {
        flex-direction: column;
    }
    
    .ctp-share-buttons {
        gap: 10px;
    }
    
    .ctp-share-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .ctp-quote {
        font-size: 0.95rem;
    }
}

/* ====================================
   ANIMATIONS & EFFECTS
   ==================================== */

/* Pulse animation for active timer */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.ctp-unit.active {
    animation: pulse 2s ease-in-out infinite;
}

/* Glow effect for buttons */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 215, 0, 0.5);
    }
}

.ctp-btn:focus {
    animation: glow 1.5s ease-in-out infinite;
    outline: none;
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ctp-pdf-section,
.ctp-share-section {
    animation: fadeInUp 0.6s ease;
}

/* ====================================
   ACCESSIBILITY
   ==================================== */
.ctp-btn:focus,
.ctp-toggle-btn:focus,
.ctp-share-btn:focus {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ctp-container {
        border: 2px solid #fff;
    }
    
    .ctp-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
