:root {
    /* Light theme variables */
    --primary-color-light: #2c3e50;
    --secondary-color-light: #3498db;
    --background-color-light: #f0f4f8;
    --text-color-light: #2c3e50;
    --form-background-light: white;
    --input-background-light: white;
    --border-color-light: #ddd;

    /* Dark theme variables */
    --primary-color-dark: #ecf0f1;
    --secondary-color-dark: #3498db;
    --background-color-dark: #121212;
    --text-color-dark: #ecf0f1;
    --form-background-dark: #2c2c2c;
    --input-background-dark: #363636;
    --border-color-dark: #404040;

    /* Common variables */
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Theme-specific variables */
[data-theme="light"] {
    --primary-color: var(--primary-color-light);
    --secondary-color: var(--secondary-color-light);
    --background-color: var(--background-color-light);
    --text-color: var(--text-color-light);
    --form-background: var(--form-background-light);
    --input-background: var(--input-background-light);
    --border-color: var(--border-color-light);
}

[data-theme="dark"] {
    --primary-color: var(--primary-color-dark);
    --secondary-color: var(--secondary-color-dark);
    --background-color: var(--background-color-dark);
    --text-color: var(--text-color-dark);
    --form-background: var(--form-background-dark);
    --input-background: var(--input-background-dark);
    --border-color: var(--border-color-dark);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-color);
    opacity: 0.8;
}

.generator-form {
    background: var(--form-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--input-background);
    color: var(--text-color);
}

.input-group .input-hint {
    display: block;
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 4px;
}

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

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 0.5rem;
}

.special-chars-input {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

button {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #2980b9;
}

.results {
    margin-top: 2rem;
    display: none;
}

.results.show {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results h2 {
    margin: 0;
}

.visibility-controls {
    display: flex;
    align-items: center;
}

.visibility-controls .checkbox-item {
    margin-bottom: 0;
}

.passwords-list {
    background: var(--input-background);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.password-item {
    padding: 0.5rem;
    background: var(--form-background);
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    flex: 1;
    margin-right: 1rem;
    word-break: break-all;
    transition: all 0.3s ease;
}

.password-text.hidden {
    filter: blur(5px);
    user-select: none;
    cursor: default;
}

.password-item button {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    width: auto;
}

.password-item button:hover {
    color: #2980b9;
}

/* Footer Styles */
.footer {
    background-color: var(--form-background);
    padding: 1rem;
    text-align: center;
    margin-top: auto;
}

.social-links {
    margin-bottom: 0.5rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0 0.5rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.footer p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Base Slider Styles */
.slider {
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.round {
    border-radius: 34px;
}

/* Theme Switch Specific Styles */
.theme-switch-wrapper {
    position: fixed;
    top: 20px;
    right: 100px;
    z-index: 100;
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.theme-slider {
    background-color: #87ceeb;
}

.theme-slider .fa-sun,
.theme-slider .fa-moon {
    color: #f39c12;
    font-size: 14px;
    z-index: 1;
}

.theme-slider .fa-moon {
    color: #f1c40f;
}

input:checked + .theme-slider {
    background-color: #2c3e50;
}

/* Language Switch Specific Styles */
.language-switch-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
}

.language-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.language-switch input {
    display: none;
}

.lang-slider {
    background-color: #3498db;
}

.lang-slider .lang-label {
    color: white;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

/* Match theme switch styles for consistency */
.language-switch input:checked + .lang-slider {
  background-color: #e74c3c; /* red in light theme */
}

[data-theme="dark"] .language-switch input:checked + .lang-slider {
  background-color: #404040; /* blackish in dark theme */
}

[data-theme="dark"] .lang-slider {
  background-color: #404040;
}

[data-theme="dark"] .lang-slider .lang-label {
  color: #ecf0f1;
}

/* Language transition effects - add opacity transition to existing transitions */
.transition-content {
    transition-property: opacity, background-color, color, transform;
    transition-duration: 0.3s;
    transition-timing-function: ease-in-out;
}

.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}

/* Language indicator style */
.language-indicator {
    position: fixed;
    top: 60px;
    right: 20px;
    background-color: var(--secondary-color);
    color: white;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 100;
}

.language-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Homepage Button Styles */
.home-button-wrapper {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.home-button:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.home-button:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Theme-specific styling */
[data-theme="light"] .home-button {
  background-color: var(--secondary-color);
  color: white;
}

[data-theme="light"] .home-button:hover {
  background-color: var(--primary-color);
  color: white;
}

[data-theme="dark"] .home-button {
  background-color: var(--secondary-color);
  color: var(--background-color-dark);
  border: 1px solid var(--border-color-dark);
}

[data-theme="dark"] .home-button:hover {
  background-color: var(--primary-color);
  color: var(--background-color-dark);
  border: 1px solid var(--primary-color);
}

/* Media queries for responsive design */
@media screen and (max-width: 767px) and (min-width: 481px) {
    .theme-switch-wrapper, .language-switch-wrapper {
        top: 10px;
    }
    
    .language-switch-wrapper {
        right: 15px;
    }
    
    .theme-switch, .language-switch {
        height: 30px;
        width: 54px;
    }
    
    .slider:before {
        height: 22px;
        width: 22px;
    }
    
    .theme-slider .fa-sun,
    .theme-slider .fa-moon {
        font-size: 12px;
    }
    
    .lang-slider .lang-label {
        font-size: 11px;
    }
    
    input:checked + .slider:before {
        transform: translateX(24px);
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-button-wrapper {
        top: 15px;
        left: 15px;
    }
      
    .home-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media screen and (max-width: 480px) {
    .theme-switch-wrapper {
        top: 10px;
        right: 85px;
    }
    
    .language-switch-wrapper {
        top: 10px;
        right: 15px;
    }
    
    .theme-switch, .language-switch {
        height: 28px;
        width: 50px;
    }
    
    .slider:before {
        height: 20px;
        width: 20px;
    }
    
    .theme-slider .fa-sun,
    .theme-slider .fa-moon {
        font-size: 11px;
    }
    
    .lang-slider .lang-label {
        font-size: 10px;
    }
    
    input:checked + .slider:before {
        transform: translateX(22px);
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .password-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .password-text {
        margin-right: 0;
        width: 100%;
    }

    .home-button-wrapper {
        top: 10px;
        left: 10px;
    }
      
    .home-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

@media screen and (max-height: 480px) and (orientation: landscape) {
    .theme-switch-wrapper, .language-switch-wrapper {
        position: absolute;
    }
    
    .language-switch-wrapper {
        right: 15px;
    }

   .home-button-wrapper {
        position: absolute;
   }
}

/* Accessibility features */
@media (prefers-reduced-motion: reduce) {
    .slider:before, .slider {
        transition: none;
    }
    
    .password-text {
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .slider {
        border: 2px solid var(--text-color);
    }
}
