/**
 * Hierarchical Flash Cards - Premium UI Design
 * 
 * Follows Alternate Design Standards with glassmorphism, premium green palette,
 * and smooth animations for the My Flash Cards hierarchical pack system.
 */

/* ============================================================================
   Hero Section
   ============================================================================ */
.flashcards-hero {
    background: linear-gradient(135deg, #F7F4EF 0%, #FEFEFE 100%);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.flashcards-hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #1A1816;
    margin-bottom: 1rem;
}

.flashcards-hero-title .gradient {
    background: linear-gradient(135deg, #5C6F5C 0%, #2d5f4d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.flashcards-hero-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ============================================================================
   CTA Buttons
   ============================================================================ */
.flashcards-cta-primary {
    background: #5C6F5C;
    border: 2px solid #5C6F5C;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    box-shadow: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.flashcards-cta-primary:hover {
    background: #2d5f4d;
    border-color: #2d5f4d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 111, 92, 0.25);
    color: white;
}

.flashcards-cta-secondary {
    background: transparent;
    color: #5C6F5C;
    border: 2px solid #5C6F5C;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    box-shadow: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.flashcards-cta-secondary:hover {
    background: rgba(92, 111, 92, 0.05);
    color: #5C6F5C;
}

/* ============================================================================
   Empty State
   ============================================================================ */
.flashcards-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.flashcards-empty-icon {
    font-size: 4rem;
    color: rgba(92, 111, 92, 0.2);
    margin-bottom: 1.5rem;
}

.flashcards-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1A1816;
    margin-bottom: 0.75rem;
}

.flashcards-empty-text {
    font-size: 1rem;
    color: #6b7280;
    max-width: 28rem;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* ============================================================================
   Pack Cards - Glassmorphism
   ============================================================================ */
.pack-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #E8E3DA;
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pack-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #9E9689;
}

.pack-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.pack-card-title-section {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pack-card-expand-icon {
    color: #5C6F5C;
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.pack-card-expand-icon.expanded {
    transform: rotate(90deg);
}

.pack-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1A1816;
    margin: 0;
}

.pack-card-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.pack-card-badge {
    background: rgba(92, 111, 92, 0.08);
    border: 1px solid rgba(92, 111, 92, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5C6F5C;
    white-space: nowrap;
}

/* ============================================================================
   Pack Actions
   ============================================================================ */
.pack-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #E8E3DA;
}

.pack-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.pack-action-btn-primary {
    background: #5C6F5C;
    color: white;
    border-color: #5C6F5C;
}

.pack-action-btn-primary:hover {
    background: #2d5f4d;
    border-color: #2d5f4d;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(92, 111, 92, 0.2);
}

.pack-action-btn-secondary {
    background: transparent;
    color: #5C6F5C;
    border-color: #E8E3DA;
}

.pack-action-btn-secondary:hover {
    background: rgba(92, 111, 92, 0.05);
    border-color: #5C6F5C;
}

.pack-action-btn-danger {
    background: transparent;
    color: #dc2626;
    border-color: #E8E3DA;
}

.pack-action-btn-danger:hover {
    background: rgba(220, 38, 38, 0.05);
    border-color: #dc2626;
}

/* ============================================================================
   Subpack Cards (Nested)
   ============================================================================ */
.pack-subpacks-container {
    margin-top: 1rem;
    margin-left: 2rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(92, 111, 92, 0.2);
    display: none;
}

.pack-subpacks-container.visible {
    display: block;
    animation: slideDown 0.3s ease;
}

.subpack-card {
    background: rgba(247, 244, 239, 0.5);
    border: 1px solid #E8E3DA;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.subpack-card:hover {
    background: rgba(247, 244, 239, 0.8);
    border-color: #9E9689;
    transform: translateX(2px);
}

.subpack-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.subpack-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1A1816;
    margin: 0;
}

.subpack-card-description {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0.25rem 0 0.5rem 0;
    line-height: 1.4;
}

/* ============================================================================
   Word List
   ============================================================================ */
.pack-words-container {
    margin-top: 1rem;
    display: none;
}

.pack-words-container.visible {
    display: block;
    animation: slideDown 0.3s ease;
}

.pack-word-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E8E3DA;
    transition: background 0.2s ease;
    cursor: pointer;
}

.pack-word-item:hover {
    background: rgba(92, 111, 92, 0.03);
}

.pack-word-item:last-child {
    border-bottom: none;
}

.pack-word-headword {
    font-size: 1rem;
    font-weight: 600;
    color: #1A1816;
    margin-bottom: 0.25rem;
}

.pack-word-pos {
    font-size: 0.75rem;
    color: #5C6F5C;
    font-style: italic;
    margin-right: 0.5rem;
}

.pack-word-definition {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ============================================================================
   Create Pack Modal
   ============================================================================ */
.pack-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.pack-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.3s ease;
}

.pack-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #E8E3DA;
}

.pack-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1816;
    margin: 0;
}

.pack-modal-body {
    padding: 1.5rem;
}

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

.pack-form-group {
    margin-bottom: 1.25rem;
}

.pack-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1A1816;
    margin-bottom: 0.5rem;
}

.pack-form-hint {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.pack-form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E8E3DA;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.pack-form-input:focus {
    outline: none;
    border-color: #5C6F5C;
    box-shadow: 0 0 0 3px rgba(92, 111, 92, 0.1);
}

.pack-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E8E3DA;
    border-radius: 6px;
    font-size: 1rem;
    min-height: 80px;
    resize: vertical;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pack-form-textarea:focus {
    outline: none;
    border-color: #5C6F5C;
    box-shadow: 0 0 0 3px rgba(92, 111, 92, 0.1);
}

.pack-form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E8E3DA;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.pack-form-select:focus {
    outline: none;
    border-color: #5C6F5C;
    box-shadow: 0 0 0 3px rgba(92, 111, 92, 0.1);
}

.pack-form-error {
    display: block;
    font-size: 0.8125rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

/* ============================================================================
   Info Box
   ============================================================================ */
.flashcards-info-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.02) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.flashcards-info-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #047857;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flashcards-info-text {
    font-size: 0.875rem;
    color: #065f46;
    line-height: 1.6;
    margin: 0;
}

/* ============================================================================
   Animations
   ============================================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 768px) {
    .flashcards-hero {
        padding: 2rem 0;
    }
    
    .flashcards-hero-title {
        font-size: 2rem;
    }
    
    .flashcards-hero-subtitle {
        font-size: 1rem;
    }
    
    .pack-card {
        padding: 1rem;
    }
    
    .pack-actions {
        flex-direction: column;
    }
    
    .pack-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pack-subpacks-container {
        margin-left: 1rem;
        padding-left: 0.75rem;
    }
    
    .pack-modal {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .pack-modal-footer {
        flex-direction: column-reverse;
    }
    
    .flashcards-cta-primary,
    .flashcards-cta-secondary {
        width: 100%;
        justify-content: center;
    }
}

