/**
 * Parents Corner Polish & Refinements
 * Final styling touches for consistency and usability
 */

/* ============================================
   Tooltips
   ============================================ */

.help-tooltip,
.inline-help-link {
    position: relative;
    cursor: help;
    transition: all 0.3s ease;
}

.help-tooltip:hover,
.inline-help-link:hover {
    transform: scale(1.1);
}

/* Tooltip content */
.help-tooltip::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Tooltip arrow */
.help-tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.help-tooltip:hover::after,
.help-tooltip:hover::before {
    opacity: 1;
}

/* Tooltip for long text */
.help-tooltip-long::after {
    white-space: normal;
    max-width: 250px;
    text-align: center;
}

/* ============================================
   Consistent Button Styling
   ============================================ */

.kids-btn {
    font-family: 'Comic Neue', cursive;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.kids-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.kids-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kids-btn:focus {
    outline: 3px solid #4ECDC4;
    outline-offset: 2px;
}

.kids-btn-primary {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
}

.kids-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.kids-btn-secondary:hover {
    background: #e0e0e0;
}

.kids-btn-danger {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%);
    color: white;
}

.kids-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.kids-btn-lg {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.kids-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   Consistent Card Styling
   ============================================ */

.parents-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.parents-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.parents-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.parents-card-icon {
    font-size: 1.5rem;
}

.parents-card-title {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.parents-card-body {
    color: #666;
    line-height: 1.6;
}

/* ============================================
   Loading States
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #4ECDC4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Skeleton loading for cards */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-guidance {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem auto;
    max-width: 500px;
    text-align: left;
}

.empty-state-guidance h4 {
    color: #4ECDC4;
    margin-bottom: 0.75rem;
}

.empty-state-guidance ul {
    margin: 0;
    padding-left: 1.5rem;
}

.empty-state-guidance li {
    margin: 0.5rem 0;
    color: #666;
}

/* ============================================
   Form Consistency
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Comic Neue', cursive;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: #FF6B6B;
}

.form-error {
    color: #FF6B6B;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-help {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ============================================
   Modal Consistency
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-appear 0.3s ease;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ============================================
   Notification Toast Styling
   ============================================ */

.parents-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.parents-toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.parents-toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.parents-toast-dismissing {
    opacity: 0;
    transform: translateX(100%);
}

.parents-toast-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.parents-toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.parents-toast-message {
    flex: 1;
    color: #333;
    line-height: 1.5;
}

.parents-toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.parents-toast-close:hover {
    background: #f0f0f0;
    color: #333;
}

.parents-toast-success {
    border-left: 4px solid #28a745;
}

.parents-toast-error {
    border-left: 4px solid #FF6B6B;
}

.parents-toast-warning {
    border-left: 4px solid #ffc107;
}

.parents-toast-info {
    border-left: 4px solid #4ECDC4;
}

.parents-toast-action {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #4ECDC4;
    cursor: pointer;
}

.parents-toast-action:hover {
    text-decoration: underline;
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #4ECDC4;
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4ECDC4;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   Responsive Refinements
   ============================================ */

@media (max-width: 768px) {
    .parents-toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .kids-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .kids-btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }

    .help-tooltip::after {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .parents-toast-container,
    .modal-overlay,
    .kids-btn,
    .help-tooltip,
    .inline-help-link {
        display: none !important;
    }

    .parents-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* ============================================
   Animation Utilities
   ============================================ */

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-up {
    animation: slideInUp 0.3s ease;
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   Color Consistency
   ============================================ */

:root {
    --color-primary: #4ECDC4;
    --color-secondary: #FF6B6B;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #FF6B6B;
    --color-info: #4ECDC4;
    --color-text: #333;
    --color-text-light: #666;
    --color-text-lighter: #999;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-border: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 6px 12px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }
