/* Decryptik PWA - Custom Styles */

/* Base */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    overscroll-behavior: none;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
}

html:not(.dark) body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 50%, #dfe4ea 100%);
}

/* Glassmorphism Card */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

html:not(.dark) .glass {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Animated Gradient Border */
.gradient-border {
    position: relative;
    background: linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
                linear-gradient(135deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #ef4444) border-box;
    border: 2px solid transparent;
    background-size: 100% 100%, 300% 300%;
    animation: gradient-rotate 4s linear infinite;
}

@keyframes gradient-rotate {
    0% { background-position: 0% 0%, 0% 50%; }
    50% { background-position: 0% 0%, 100% 50%; }
    100% { background-position: 0% 0%, 0% 50%; }
}

/* Glow Effects */
.glow-red {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3),
                0 0 40px rgba(239, 68, 68, 0.1),
                inset 0 0 20px rgba(239, 68, 68, 0.05);
}

.glow-green {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3),
                0 0 40px rgba(34, 197, 94, 0.1),
                inset 0 0 20px rgba(34, 197, 94, 0.05);
}

.glow-purple {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4),
                0 0 60px rgba(139, 92, 246, 0.2);
}

/* Neon Text */
.neon-text {
    text-shadow: 0 0 10px currentColor,
                 0 0 20px currentColor,
                 0 0 40px currentColor;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Glow */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.8), 0 0 60px rgba(239, 68, 68, 0.4); }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #444;
}

/* Output Mode Buttons */
/* Language Buttons */
.lang-btn.active {
    background: rgba(139, 92, 246, 0.15);
}
.lang-btn.active::after {
    content: '✓';
    margin-left: auto;
    font-size: 14px;
    font-weight: bold;
    color: #8b5cf6;
}

/* Text Area */
#textArea {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

#textArea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.dark #textArea::placeholder {
    color: #4b5563;
}

/* Action buttons hover effect */
.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, currentColor 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.action-btn:hover::after {
    opacity: 0.1;
}

.action-btn:active {
    transform: scale(0.9);
}

/* Button Press Effect */
button:active {
    transform: scale(0.97);
}

/* Toast Animation */
#toast {
    background: linear-gradient(135deg, #1f2937, #374151);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.dark #toast {
    background: linear-gradient(135deg, #374151, #4b5563);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Menu Animation */
#menuOverlay {
    backdrop-filter: blur(4px);
}

#menuOverlay.open {
    opacity: 1;
    pointer-events: auto;
}

#menuOverlay.open #sideMenu {
    transform: translateX(0);
}

#sideMenu {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.dark #sideMenu {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

/* Menu items */
.menu-item {
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ef4444, #f59e0b);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.menu-item:hover::before {
    transform: scaleY(1);
}

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

/* Pulse Animation for Success */
@keyframes pulse-success {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.pulse-success {
    animation: pulse-success 0.5s ease-out;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Password Strength Indicator */
.password-strength {
    height: 3px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength.weak { background: #ef4444; width: 33%; }
.password-strength.medium { background: #f59e0b; width: 66%; }
.password-strength.strong { background: #22c55e; width: 100%; }

/* Focus Styles */
input:focus, textarea:focus {
    outline: none;
}

/* Selection */
::selection {
    background: rgba(239, 68, 68, 0.3);
}

/* Safe Area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    main {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* Premium Badge */
.premium-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

/* Share Menu Animation */
#shareOverlay.open {
    opacity: 1;
    pointer-events: auto;
}

#shareOverlay.open #shareMenu {
    transform: translateY(0);
}

.share-target:active {
    transform: scale(0.9);
}

/* Disabled State */
.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== Privacy Consent Modal ==================== */
.pp-content {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.7;
    padding-right: 8px;
}
.pp-content h3 {
    color: #d4af37;
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 8px;
}
.pp-content p {
    margin-bottom: 8px;
}
.pp-content ul {
    padding-left: 20px;
    margin: 8px 0 12px;
}
.pp-content li {
    margin-bottom: 4px;
}
.pp-content .pp-updated {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 16px;
}
.pp-content .pp-highlight {
    background: rgba(212, 175, 55, 0.1);
    border-left: 3px solid #d4af37;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 4px;
}
.pp-accept-btn {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37 0%, #b8941e 100%);
    color: #0f0f1a;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 14px 32px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}
.pp-accept-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.5);
}
.pp-accept-btn:active {
    transform: scale(0.97);
}
