/* Detoxify Custom Styles - Grainy Paper & Sticky Note Aesthetic */

/* Grainy Texture Overlay */
body {
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* Sticky Note Button Style */
.sticky-btn {
    background: linear-gradient(135deg, #fff8dc 0%, #ffeaa7 100%) !important;
    border: 2px solid #d4a574 !important;
    color: #2d3436 !important;
    padding: 12px 24px;
    font-weight: 600;
    position: relative;
    transform: rotate(-1deg);
    box-shadow: 
        2px 2px 4px rgba(0,0,0,0.2),
        4px 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.sticky-btn:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 
        3px 3px 6px rgba(0,0,0,0.25),
        6px 6px 12px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%) !important;
    color: #2d3436 !important;
}

.sticky-btn:active {
    transform: rotate(-1deg) translateY(0px);
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Sticky Note Card/Container */
.sticky-card {
    background: linear-gradient(135deg, #fff8dc 0%, #ffeaa7 100%);
    border: 2px solid #d4a574;
    border-radius: 4px;
    padding: 20px;
    position: relative;
    transform: rotate(-0.5deg);
    box-shadow: 
        2px 2px 4px rgba(0,0,0,0.15),
        4px 4px 8px rgba(0,0,0,0.08);
}

.sticky-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 24px,
        rgba(180, 160, 120, 0.1) 25px
    );
    pointer-events: none;
}

/* Form Container */
.form-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 
        0 4px 6px rgba(0,0,0,0.1),
        0 8px 16px rgba(0,0,0,0.05);
    position: relative;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    border-radius: 12px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Paper Texture Background Option */
.paper-bg {
    background: #f5f5f0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' result='noise' numOctaves='5'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23fff' surfaceScale='2'%3E%3CfeDistantLight azimuth='45' elevation='60'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23paper)' opacity='0.4'/%3E%3C/svg%3E");
}

/* Admin Panel Styles */
.admin-header {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    padding: 30px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.admin-header h1 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Form Builder Styles */
.field-builder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.field-builder:hover {
    border-color: #ffeaa7;
    background: #fffef8;
}

.field-preview {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #e9ecef;
}

/* Star Rating */
.star-rating {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
}

.star-rating .star {
    transition: color 0.2s ease;
}

.star-rating .star.filled {
    color: #ffc107;
}

.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    color: #ffc107;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #4CAF50;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
}

.toggle-switch.active::after {
    transform: translateX(30px);
}

/* Section Divider */
.section-divider {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #ffeaa7, transparent);
    margin: 30px 0;
    position: relative;
}

.section-divider::before {
    content: '✦';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 0 15px;
    color: #ffeaa7;
    font-size: 20px;
}

/* Glass Shimmer Effect (for Glass Shimmer Theme) */
.glass-shimmer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.glass-shimmer .text-reveal {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .sticky-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .form-container {
        padding: 20px;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ffeaa7;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #fdcb6e;
}

/* Passcode Gate */
.passcode-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.passcode-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}

/* Export Button */
.btn-export {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%) !important;
    border: none !important;
    color: #fff !important;
}

/* Delete Button */
.btn-delete {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%) !important;
    border: none !important;
    color: #fff !important;
}

/* Table Styles */
.table-sticky {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table-sticky thead {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utility Classes */
.rotate-slight {
    transform: rotate(-0.5deg);
}

.shadow-paper {
    box-shadow: 
        2px 2px 4px rgba(0,0,0,0.15),
        4px 4px 8px rgba(0,0,0,0.08);
}