/* Reset và thiết lập cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: linear-gradient(135deg, rgba(235, 248, 255, 0.7), rgba(230, 252, 242, 0.7), rgba(255, 255, 255, 0.8));
    --container-bg: rgba(255, 255, 255, 0.9);
    --text-color: #2c3e50;
    --secondary-text: #5d7b90;
    --primary-gradient: linear-gradient(135deg, #0a97b7, #16a085);
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --border-color: rgba(0, 0, 0, 0.05);
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-hover: rgba(237, 252, 248, 0.7);
    --header-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 248, 255, 0.6) 100%);
    --input-header-bg: linear-gradient(90deg, rgba(240, 248, 255, 0.5), rgba(240, 255, 248, 0.5));
    --overlay-bg: rgba(255, 255, 255, 0.9);
    --toggle-color: #0a97b7;
    --accent-color: #16a085;
    --icon-color: #0a97b7;
    --feature-bg: rgba(255, 255, 255, 0.9);
    --feature-icon-bg: rgba(10, 151, 183, 0.15);
    --btn-color: #ffffff;
    --btn-hover: linear-gradient(135deg, #16a085, #0a97b7);
    --btn-shadow: 0 4px 12px rgba(10, 151, 183, 0.3);
    --border-radius: 16px;
    --card-border-radius: 20px;
    --btn-border-radius: 50px;
}

.dark-mode {
    --bg-color: linear-gradient(135deg, rgba(20, 40, 55, 0.95), rgba(22, 45, 40, 0.95), rgba(25, 34, 48, 0.95));
    --container-bg: rgba(30, 42, 56, 0.8);
    --text-color: #ecf0f1;
    --secondary-text: #a7b8c5;
    --primary-gradient: linear-gradient(135deg, #0fb8d4, #1abc9c);
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --border-color: rgba(255, 255, 255, 0.1);
    --sidebar-bg: rgba(30, 42, 56, 0.9);
    --input-bg: rgba(40, 55, 71, 0.6);
    --input-hover: rgba(45, 62, 80, 0.7);
    --header-bg: linear-gradient(180deg, rgba(30, 42, 56, 0.95) 0%, rgba(22, 34, 45, 0.8) 100%);
    --input-header-bg: linear-gradient(90deg, rgba(22, 34, 45, 0.5), rgba(22, 45, 40, 0.5));
    --overlay-bg: rgba(20, 40, 55, 0.9);
    --toggle-color: #0fb8d4;
    --accent-color: #1abc9c;
    --icon-color: #0fb8d4;
    --feature-bg: rgba(30, 42, 56, 0.8);
    --feature-icon-bg: rgba(15, 184, 212, 0.25);
    --btn-color: #ecf0f1;
    --btn-hover: linear-gradient(135deg, #1abc9c, #0fb8d4);
    --btn-shadow: 0 4px 12px rgba(15, 184, 212, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Container chính */
.app-container {
    display: flex;
    height: 100vh;
    max-width: 100vw;
    position: relative;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--container-bg);
    border-radius: 50%;
    box-shadow: var(--box-shadow);
    z-index: 100;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.mobile-toggle i {
    color: var(--toggle-color);
    font-size: 18px;
}

.mobile-toggle:hover {
    transform: scale(1.05);
}

.mobile-toggle:active {
    transform: scale(0.95);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
    transition: all 0.3s ease;
    padding: 20px 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--icon-color);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
}

.sidebar-history {
    padding: 20px;
}

.sidebar-history h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--secondary-text);
}

.history-list {
    list-style-type: none;
}

.history-list li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: var(--input-bg);
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.history-list li:hover {
    background-color: var(--input-hover);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.history-list li.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 3px 10px rgba(10, 151, 183, 0.3);
}

/* Khu vực chính */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: var(--header-bg);
    backdrop-filter: blur(5px);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(10, 151, 183, 0.1);
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
}

.header-subtitle {
    font-size: 16px;
    color: var(--secondary-text);
    font-weight: 400;
    letter-spacing: -0.2px;
    margin-bottom: 5px;
}

/* Container dịch */
.translation-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 300px);
    max-width: 1200px;
    margin: 0 auto;
}

.input-container, .output-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--container-bg);
    border-radius: var(--card-border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
}

.input-header, .output-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--input-header-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-options select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--container-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.input-options select:hover {
    border-color: rgba(10, 151, 183, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.input-options select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(10, 151, 183, 0.2);
}

.input-header h2, .output-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
}

.input-header h2 i, .output-header h2 i, .sidebar-header h2 i, .sidebar-history h3 i, .header h1 i {
    margin-right: 5px;
    opacity: 0.8;
    color: var(--icon-color);
}

#originalPoem {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 20px;
    font-size: 16px;
    font-family: inherit;
    background-color: transparent;
    line-height: 1.8;
    color: var(--text-color);
}

.output-area {
    flex: 1;
    padding: 20px;
    font-size: 16px;
    line-height: 1.8;
    overflow-y: auto;
    white-space: pre-wrap;
    color: var(--text-color);
}

.action-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
}

.translate-btn {
    background: var(--primary-gradient);
    color: var(--btn-color);
    border: none;
    border-radius: var(--btn-border-radius);
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--btn-shadow);
    position: relative;
    overflow: hidden;
}

.translate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
}

.translate-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 151, 183, 0.4);
}

.translate-btn:hover::before {
    left: 100%;
}

.translate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(10, 151, 183, 0.3);
}

.translate-btn i {
    margin-right: 8px;
}

/* Feature Section */
.feature-section {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.feature {
    flex: 1;
    background-color: var(--feature-bg);
    padding: 25px;
    border-radius: var(--card-border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background-color: var(--feature-icon-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(10, 151, 183, 0.15);
}

.feature:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(10, 151, 183, 0.25);
}

.feature-icon i {
    font-size: 32px;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.feature:hover .feature-icon i {
    transform: scale(1.1);
}

.feature h3 {
    margin-bottom: 10px;
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
}

.feature p {
    color: var(--secondary-text);
    font-size: 15px;
    line-height: 1.6;
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-text {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.2px;
    margin-top: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.container {
    width: 200px;
    height: 200px;
    position: relative;
    filter: url("#goo");
    animation: rotate-move 2s ease-in-out infinite;
    transform: none;
    margin: 0 auto;
}

.dot {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

.dot-3 {
    background-color: #0a97b7;
    animation: dot-3-move 2s ease infinite, index 6s ease infinite;
}

.dark-mode .dot-3 {
    background-color: #0fb8d4;
}

.dot-2 {
    background-color: #16a085;
    animation: dot-2-move 2s ease infinite, index 6s -4s ease infinite;
}

.dot-1 {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: dot-1-move 2s ease infinite, index 6s -2s ease infinite;
}

.dark-mode .dot-1 {
    background-color: #f1f1f1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes dot-3-move {
    20% {
        transform: scale(1);
    }
    45% {
        transform: translateY(-18px) scale(0.45);
    }
    60% {
        transform: translateY(-90px) scale(0.45);
    }
    80% {
        transform: translateY(-90px) scale(0.45);
    }
    100% {
        transform: translateY(0px) scale(1);
    }
}

@keyframes dot-2-move {
    20% {
        transform: scale(1);
    }
    45% {
        transform: translate(-16px, 12px) scale(0.45);
    }
    60% {
        transform: translate(-80px, 60px) scale(0.45);
    }
    80% {
        transform: translate(-80px, 60px) scale(0.45);
    }
    100% {
        transform: translateY(0px) scale(1);
    }
}

@keyframes dot-1-move {
    20% {
        transform: scale(1);
    }
    45% {
        transform: translate(16px, 12px) scale(0.45);
    }
    60% {
        transform: translate(80px, 60px) scale(0.45);
    }
    80% {
        transform: translate(80px, 60px) scale(0.45);
    }
    100% {
        transform: translateY(0px) scale(1);
    }
}

@keyframes rotate-move {
    55% {
        transform: rotate(0deg);
    }
    80% {
        transform: rotate(360deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes index {
    0%,
    100% {
        z-index: 3;
    }
    33.3% {
        z-index: 2;
    }
    66.6% {
        z-index: 1;
    }
}

/* Dialog thông báo */
.custom-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.dialog-content {
    background: linear-gradient(135deg, rgba(235, 248, 255, 0.95), rgba(230, 252, 242, 0.95));
    border-radius: var(--card-border-radius);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: dialogFadeIn 0.3s ease-out forwards;
}

.dark-mode .dialog-content {
    background: linear-gradient(135deg, rgba(20, 40, 55, 0.95), rgba(22, 45, 40, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.dialog-title {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.dialog-message {
    font-size: 16px;
    margin-bottom: 25px;
    color: var(--secondary-text);
}

.dialog-button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--btn-border-radius);
    padding: 10px 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(10, 151, 183, 0.3);
    position: relative;
    overflow: hidden;
}

.dialog-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
}

.dialog-button:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 151, 183, 0.4);
}

.dialog-button:hover::before {
    left: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    .translation-container {
        flex-direction: column;
        height: auto;
        max-height: calc(100vh - 330px);
    }
    
    .input-container, .output-container {
        height: 40vh;
        max-height: 300px;
    }
    
    .action-container {
        padding: 20px 0;
    }
    
    .feature-section {
        flex-direction: column;
        margin-top: 20px;
    }
    
    .feature {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    
    .feature-icon i {
        font-size: 28px;
    }
    
    .feature h3 {
        font-size: 18px;
    }
    
    .feature p {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .main-content {
        height: 100%;
        padding: 20px;
        padding-top: 70px;
    }
    
    /* Ẩn sidebar mặc định trên mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        z-index: 90;
        transition: left 0.3s ease;
    }
    
    /* Class để hiện sidebar khi toggle */
    .sidebar.active {
        left: 0;
    }

    .header h1 {
        font-size: 24px;
    }
    
    .header-subtitle {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .translation-container {
        gap: 15px;
        height: calc(100vh - 270px);
    }
    
    .input-container, .output-container {
        height: 45vh;
        max-height: none;
    }
    
    .action-container {
        padding: 15px 0;
    }
    
    .feature-section {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    
    .header-subtitle {
        font-size: 13px;
    }
    
    .input-header h2, .output-header h2 {
        font-size: 16px;
    }
    
    .input-options select {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .translate-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon i {
        font-size: 24px;
    }
    
    .feature h3 {
        font-size: 16px;
    }
    
    .feature p {
        font-size: 13px;
    }
}

/* Switch Theme Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch #input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #0a97b7;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  z-index: 0;
  overflow: hidden;
}

.sun-moon {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

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

#input:focus + .slider {
  box-shadow: 0 0 1px #0a97b7;
}

#input:checked + .slider .sun-moon {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
  background-color: #ecf0f1;
}

.slider.round {
  border-radius: 34px;
} 