:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --accent-primary: #4caf50;
    --accent-hover: #45a049;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-primary: #4caf50;
    --accent-hover: #45a049;
    --card-bg: #374151;
    --card-border: #4b5563;
    --input-bg: #4b5563;
    --input-border: #6b7280;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Poppins, sans-serif;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

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

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

.title-section {
    animation: fadeInDown 0.5s ease;
}

.title-section h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

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

.header-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    animation: fadeIn 0.5s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    transform: rotate(360deg);
}

.menu-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
    animation: fadeIn 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-button:hover {
    background: var(--bg-secondary);
}

.dropdown-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    min-width: 200px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--accent-primary);
}

.card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.upload-section {
    padding: 2rem;
}

.upload-area {
    border: 2px dashed var(--card-border);
    border-radius: 1rem;
    padding: clamp(2rem, 6vw, 3rem) clamp(1rem, 4vw, 2rem);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    transform: scale(1.01);
}

.upload-icon {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    color: var(--accent-primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.15));
    transition: transform 0.4s ease;
}

.upload-area:hover .upload-icon {
    transform: translateY(-5px);
    animation: pulse 2s infinite;
}

.upload-text h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: clamp(1.1rem, 3vw, 1.3rem);
}

.upload-text p {
    color: var(--text-secondary);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.file-input {
    display: none;
}

.button {
    background: var(--accent-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
}

.button i {
    font-size: 1.1rem;
}

.file-info {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.8rem;
    margin-bottom: 1rem;
    display: none;
    animation: fadeIn 0.5s ease;
    border-left: 4px solid var(--accent-primary);
}

.file-info.show {
    display: block;
}

.file-info p {
    margin: 0.8rem 0;
    color: var(--text-secondary);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.file-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.result-card {
    display: none;
    animation: fadeInUp 0.5s ease;
}

.result-card.show {
    display: block;
}

.result-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--bg-secondary);
}

.result-body {
    padding: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
}

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

.result-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.result-value {
    color: var(--text-primary);
    font-weight: 500;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    background: var(--bg-secondary);
}

.refresh-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.refresh-button:hover {
    background: var(--bg-primary);
    transform: rotate(90deg);
    color: var(--error);
}

.copy-button {
    background: var(--accent-primary);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-button:hover {
    background: var(--accent-hover);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.loading-spinner:before,
.loading-spinner:after {
    content: '';
    display: block;
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--accent-primary);
    border-bottom-color: #fff;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.loading-spinner:after {
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite reverse;
    border-top-color: #fff;
    border-bottom-color: var(--accent-primary);
}

.toast {
    position: fixed;
    top: 20px; 
    right: 20px;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    opacity: 1;       
}

.toast.show {
    display: block;
    animation: slideInRight 0.3s ease forwards;
}

.toast.hide {
    animation: slideOutRight 0.3s ease forwards;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

.toast.warning {
    background: var(--warning);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

.copy-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

#fileUrl {
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 0.5rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    width: 100%;
    margin-bottom: 0.5rem;
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    
    50% {
        transform: scale(1.1);
    }
    
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@media (max-width: 768px) {

    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .title-section h1 {
        font-size: 1.75rem;
    }

    .upload-section {
        padding: 1rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .copy-container {
        flex-direction: column;
    }
    
    .dropdown-menu {
        right: 10px;
    }
}
