/* ==========================================================================
   Epplicon Technologies - Advanced Features Stylesheet
   Dark Mode, Back to Top, Toast Notifications, etc.
   ========================================================================== */

/* --- DARK MODE TOGGLE --- */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    z-index: 999;
    transition: var(--transition-smooth);
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
}

.theme-toggle.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(13, 110, 253, 0.4);
}

.theme-toggle:focus {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 3px;
}

/* --- BACK TO TOP BUTTON --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    z-index: 999;
    transition: var(--transition-smooth);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    text-decoration: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(13, 110, 253, 0.4);
}

.back-to-top:focus {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 3px;
}

/* Adjust position when both buttons are visible */
.theme-toggle.visible ~ .back-to-top.visible,
.back-to-top.visible ~ .theme-toggle.visible {
    bottom: 100px;
}

/* --- READING PROGRESS BAR --- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #4dabf7);
    z-index: 2000;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.5);
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.toast {
    background: var(--surface-color);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.toast-close:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

/* --- CONTACT FORM --- */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    background: var(--background-color);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group .error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #ef4444;
}

.form-group.success input,
.form-group.success textarea,
.form-group.success select {
    border-color: #10b981;
}

.form-submit {
    width: 100%;
    margin-top: 1rem;
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- LOADING SPINNER (for forms) --- */
.form-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

/* --- SEARCH BAR (Blog) --- */
.blog-search {
    max-width: 600px;
    margin: 0 auto 3rem;
    position: relative;
}

.blog-search input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.blog-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.blog-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.blog-search button:hover {
    background: #0056b3;
    transform: translateY(-50%) scale(1.1);
}

/* --- READING TIME BADGE --- */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 12px;
    background: var(--background-color);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: 1rem;
}

.reading-time i {
    color: var(--primary-color);
}

/* --- ENHANCED CARD HOVER EFFECTS --- */
.service-card,
.work-card,
.blog-card {
    position: relative;
    overflow: hidden;
}

.service-card::before,
.work-card::before,
.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.service-card:hover::before,
.work-card:hover::before,
.blog-card:hover::before {
    left: 100%;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .theme-toggle,
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }

    .theme-toggle.visible ~ .back-to-top.visible,
    .back-to-top.visible ~ .theme-toggle.visible {
        bottom: 80px;
    }

    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }

    .contact-form {
        padding: 1.5rem;
    }
}

/* --- PRINT STYLES --- */
@media print {
    .theme-toggle,
    .back-to-top,
    .reading-progress,
    .toast-container,
    .main-header,
    .site-footer,
    .mobile-nav-toggle,
    .mobile-nav {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .btn {
        display: none;
    }
}

