/* ===== COMPONENT STYLES ===== */

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    background-color: rgba(88, 86, 214, 0.1);
}

.theme-toggle__icon {
    position: absolute;
    font-size: var(--font-size-lg);
    transition: all var(--transition-normal);
}

.theme-toggle__icon--sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle__icon--moon {
    opacity: 0;
    transform: rotate(180deg) scale(0.8);
}

[data-theme="dark"] .theme-toggle__icon--sun {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
}

[data-theme="dark"] .theme-toggle__icon--moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ===== BABY ICON COMPONENT ===== */
.baby-icon {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.baby-face {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.eye {
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 18px;
}

.eye.left {
    left: 18px;
}

.eye.right {
    right: 18px;
}

.mouth {
    width: 15px;
    height: 8px;
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 15px 15px;
    position: absolute;
    bottom: 15px;
}

.pacifier {
    width: 8px;
    height: 8px;
    background: #FF6B9D;
    border-radius: 50%;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* Small baby icon for project logos */
.project-card__logo--baby .baby-icon {
    width: 30px;
    height: 30px;
}

.project-card__logo--baby .baby-face {
    width: 20px;
    height: 20px;
}

.project-card__logo--baby .eye {
    width: 2px;
    height: 2px;
    top: 6px;
}

.project-card__logo--baby .eye.left {
    left: 6px;
}

.project-card__logo--baby .eye.right {
    right: 6px;
}

.project-card__logo--baby .mouth {
    width: 6px;
    height: 3px;
    bottom: 5px;
}

.project-card__logo--baby .pacifier {
    width: 3px;
    height: 3px;
    right: 2px;
}

/* ===== CARD COMPONENTS ===== */
.card {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card__header {
    margin-bottom: var(--space-lg);
}

.card__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.card__subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.card__content {
    margin-bottom: var(--space-lg);
}

.card__footer {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

/* ===== FORM COMPONENTS ===== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(88, 86, 214, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: #e74c3c;
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

.form-success {
    color: #27ae60;
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

/* ===== LOADING COMPONENTS ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

.loading--large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ===== BADGE COMPONENTS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge--primary {
    background-color: var(--primary-color);
    color: var(--text-inverse);
}

.badge--secondary {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge--success {
    background-color: #27ae60;
    color: var(--text-inverse);
}

.badge--warning {
    background-color: #f39c12;
    color: var(--text-inverse);
}

.badge--error {
    background-color: #e74c3c;
    color: var(--text-inverse);
}

/* ===== TOOLTIP COMPONENTS ===== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip__content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: var(--text-inverse);
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    z-index: var(--z-tooltip);
    transition: all var(--transition-fast);
}

.tooltip__content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
}

.tooltip:hover .tooltip__content {
    visibility: visible;
    opacity: 1;
}

/* ===== MODAL COMPONENTS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal--active {
    opacity: 1;
    visibility: visible;
}

.modal__content {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal--active .modal__content {
    transform: scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.modal__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.modal__close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

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

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

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

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

.font-bold {
    font-weight: var(--font-weight-bold);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.bg-primary {
    background-color: var(--bg-primary);
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full-width {
        width: 100%;
    }
    
    .mobile-text-center {
        text-align: center;
    }
}

@media (min-width: 769px) {
    .desktop-hidden {
        display: none;
    }
}
