:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #ef233c;
    
    --gradient-primary: linear-gradient(135deg, #4361ee, #3a0ca3);
    --gradient-accent: linear-gradient(135deg, #f72585, #b5179e);
    --gradient-success: linear-gradient(135deg, #4cc9f0, #4895ef);
    
    --border-radius: 12px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f7ff;
    color: var(--dark-color);
    line-height: 1.6;
    user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
    z-index: 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

header h1 i {
    margin-right: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.search-container {
    max-width: 600px;
    margin: 20px auto 0;
    position: relative;
    z-index: 1;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 15px;
    padding-top: 15px;
}
.search-container input {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 15px;
    padding-top: 15px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.search-container input:focus {
    outline: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.search-container button {
    position: absolute;
    right: 5px;
    top: 5px;
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: 50px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin-top: 12px;
    margin-right: 12px;
    transition: var(--transition);
}

.search-container button:hover {
    transform: scale(1.05);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.category-card:hover::before {
    height: 10px;
}

.icon-container {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    transition: var(--transition);
}

.category-card:hover .icon-container {
    background: var(--gradient-accent);
    transform: rotate(15deg) scale(1.1);
}

.category-card h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

.category-card p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.dictionary-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.content-header h2 {
    color: var(--primary-color);
}

#back-btn {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

#back-btn:hover {
    transform: translateX(-5px);
}

#back-btn.hidden {
    display: none;
}

.welcome-message {
    text-align: center;
    padding: 20px 0;
}

.welcome-message img {
    max-width: 200px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.welcome-message h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}



footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-color);
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: var(--gray-color);
    margin: 0 10px;
    font-size: 1.2rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .dictionary-content {
        padding: 20px;
    }
    
    .word-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .search-container input {
        padding: 12px 15px;
    }
    
    .category-card {
        padding: 20px 15px;
    }
}
/* Category Page Specific Styles */
.error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}

#back-btn {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px auto;
    transition: var(--transition);
}

#back-btn:hover {
    transform: translateX(-5px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .word-list {
        grid-template-columns: 1fr;
    }
}
/* Search Results Styles */
.search-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.category-tag {
    background: var(--accent-color);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 8px;
    text-transform: capitalize;
}

/* Loading and Error States */
.loading {
    text-align: center;
    color: var(--primary-color);
    font-style: italic;
}

.error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
}

/* Search Results Styles */
.search-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.category-tag {
    background: var(--accent-color);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 8px;
    text-transform: capitalize;
}

/* ===== Mobile View Adjustments ===== */
@media (max-width: 600px) {
    /* Home Page - 2 cards per row */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-card {
        padding: 15px 10px;
    }
    
    /* Content Page - 2 items per row */
    .word-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .word-item {
        padding: 12px;
        font-size: 14px;
    }
    
    .word-item h3 {
        font-size: 16px;
    }
}

/* ===== Smaller Phones (Galaxy Fold, etc) ===== */
@media (max-width: 400px) {
    .category-grid,
    .word-list {
        grid-template-columns: 1fr; /* 1 per row if screen too small */
    }
}
/* Header Container Styling */
.site-title {
    display: flex;
    justify-content: center; /* Horizontal center */
    align-items: center; /* Vertical center */
    gap: 15px;
    margin: 0 auto; /* Auto margins help in centering */
    width: fit-content; /* Only take needed space */
    padding: 10px 20px;
  }
  
  /* Alternative: Use Text Wrapper */
  .site-title {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  
  .title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
  }
  .header-container {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .logo {
    height: 40px; /* Adjust size as needed */
    width: auto;
  }
  
  /* Mobile Responsive */
  @media (max-width: 768px) {
    .logo {
      height: 30px;
    }
  }
  /* Base Styles */
.word-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #4a6bff;
  }
  
  .word-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-left-color: #ff6b6b;
  }
  
  .word-item h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
  }
  
  .word-item h3 i {
    margin-right: 10px;
    color: #4a6bff;
  }
  
  .view-details {
    color: #4a6bff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .view-details:hover {
    color: #ff6b6b;
  }
  
  .view-details i {
    margin-left: 5px;
    transition: all 0.2s;
  }
  
  .view-details:hover i {
    transform: translateX(3px);
  }
  
  /* Detail View Styles */
  .detail-view {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }
  
  .detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #e0e6ed;
    padding-bottom: 15px;
  }
  
  .detail-header h2 {
    color: #2c3e50;
    margin: 0;
    flex-grow: 1;
    font-size: 1.8rem;
  }
  
  .back-btn {
    background: #4a6bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
    margin-right: 15px;
  }
  
  .back-btn i {
    margin-right: 5px;
  }
  
  .back-btn:hover {
    background: #3a5bef;
    transform: translateX(-3px);
  }
  
  .detail-section {
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }
  
  .detail-section h3 {
    color: #4a6bff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
  }
  
  .detail-section h3::before {
    content: "-";
    color: #ff6b6b;
    margin-right: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(to right, #ff6b6b, #ff9a9a); /* Gradient effect */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* Gradient on text */
    text-shadow: 1px 1px 2px rgba(255, 107, 107, 0.5); /* Matching shadow */
    transform: rotate(-20deg); /* Slight tilt */
    
  }
  
  .detail-section p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
  }
  
  .example {
    font-style: italic;
    color: #718096;
    padding-left: 15px;
    border-left: 3px solid #e2e8f0;
  }
  
  .category-tag {
    background: #4a6bff;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
    vertical-align: middle;
  }
  
  /* Animation Effects */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .detail-view {
    animation: fadeIn 0.3s ease-out;
  }
  
  .detail-section {
    transition: all 0.3s;
  }
  
  .detail-section:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  }
  .detail-section p {
    line-height: 1.5;
}
.detail-section p::before {
    content: "\2605";
    color: #4911e4;
    margin-right: 5px;
    font-weight: bold;
}
.detail-section h3::before {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); /* Subtle shadow */
}