:root {
    --primary-color: #3a6ea5;
    --secondary-color: #5c7aed;
    --background-color: #f4f7f6;
    --text-color: #333;
    --white: #ffffff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
}

.profile-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    overflow: hidden;
    margin-bottom: 15px;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.add-image-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.logo svg {
    width: 50px;
    height: 50px;
    color: var(--primary-color);
    margin-right: 10px;
}

.logo span {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s;
    margin-bottom: 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255,255,255,0.2);
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

h1 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.password-entry {
    background-color: var(--background-color);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-entry:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.add-password-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
}

.add-password-form input,
.add-password-form textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
}

.add-password-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-password-form button:hover {
    background-color: var(--secondary-color);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: modalSlideIn 0.3s ease-out;
    margin: auto;
}

#imageUrlModal .modal-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
}

#imageUrlModal input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#imageUrlModal button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

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

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #888;
}

.import-container, .export-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-upload-btn svg {
    margin-right: 10px;
}

.password-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.password-details h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.password-details p {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.password-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.show-password-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.show-password-btn:hover {
    background-color: var(--primary-color);
}

.delete-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 15px;
    align-self: flex-start;
}

.delete-btn:hover {
    background-color: #ff3333;
}

/* Success Notification Styles */
.success-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1100;
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 3s forwards;
}

.success-notification svg {
    width: 24px;
    height: 24px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Import Tab Improvements */
.import-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.import-card {
    background-color: var(--background-color);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease;
}

.import-card:hover {
    transform: translateY(-10px);
}

.import-icon {
    width: 80px;
    height: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.import-card h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.import-card p {
    color: var(--text-color);
    margin-bottom: 20px;
}

.file-input {
    display: none;
}

.import-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-button:hover {
    background-color: var(--secondary-color);
}

.import-help {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
}

/* Social Links Styles */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 15px;
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link svg {
    width: 30px;
    height: 30px;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Dark Mode Styles */
body.dark-mode {
    --primary-color: #5c7aed;
    --secondary-color: #3a6ea5;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --white: #1e1e1e;
}

body.dark-mode .sidebar {
    background-color: #1e1e1e;
}

body.dark-mode .nav-item:hover, 
body.dark-mode .nav-item.active {
    background-color: rgba(255,255,255,0.1);
}

body.dark-mode .import-card {
    background-color: #1e1e1e;
}

body.dark-mode .social-link {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-mode .profile-image-container {
    background-color: rgba(255,255,255,0.05);
}

/* Mobile Responsiveness Enhancements */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-close-menu {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    color: white;
}

.mobile-close-menu svg {
    width: 24px;
    height: 24px;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-header {
        margin-bottom: 20px;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100vh;
        transition: left 0.3s ease-in-out;
        z-index: 2000;
        overflow-y: auto;
    }

    .sidebar.mobile-menu-open {
        left: 0;
    }

    .mobile-close-menu {
        display: block;
    }

    .main-content {
        padding: 15px;
        width: 100%;
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-item {
        width: 100%;
        text-align: left;
        padding: 15px;
        justify-content: flex-start;
    }

    .nav-item svg {
        margin-right: 15px;
    }

    .sidebar.mobile-menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: -1;
    }

    .password-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .modal-content {
        width: 95%;
        margin: auto;
        padding: 20px;
    }

    .add-password-form {
        max-width: 100%;
    }

    .add-password-form input,
    .add-password-form textarea {
        width: 100%;
    }

    .social-links {
        grid-template-columns: 1fr;
    }

    .import-card {
        padding: 20px;
        max-width: 100%;
    }

    .logo svg {
        width: 40px;
        height: 40px;
    }

    .logo span {
        font-size: 1.5rem;
    }

    .nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .nav-item,
    .password-entry,
    .social-link,
    .import-button,
    .export-btn,
    .add-password-form button {
        min-height: 48px; 
        padding: 12px;
    }
}

/* Ensure proper scaling */
@viewport {
    width: device-width;
    zoom: 1;
}

input, textarea, button {
    font-size: 16px; 
}

.image-upload-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    width: 100%;
    padding: 30px;
}

.upload-options {
    display: flex;
    gap: 20px;
}

.url-upload, 
.file-upload {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.url-upload input, 
.file-upload input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
}

.url-upload button, 
.file-upload button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.url-upload button:hover, 
.file-upload button:hover {
    background-color: var(--secondary-color);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .upload-options {
        flex-direction: column;
    }
}

.account-name-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    gap: 10px;
}

#accountName {
    background-color: transparent;
    border: none;
    text-align: center;
    font-weight: bold;
    color: white;
    width: 150px;
    cursor: default;
}

.edit-account-name-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-account-name-btn svg {
    width: 20px;
    height: 20px;
}

body.dark-mode #accountName {
    color: #e0e0e0;
}

.first-time-modal {
    display: none;
    z-index: 2000;
}

.first-time-modal.active {
    display: flex;
}

.first-time-content {
    text-align: center;
    max-width: 400px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.first-time-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.first-time-profile .profile-image-container {
    width: 150px;
    height: 150px;
}

.first-time-buttons {
    display: flex;
    gap: 15px;
}

.first-time-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#skipFirstTimeSetup {
    background-color: #f0f0f0;
    color: #333;
}

#saveFirstTimeSetup {
    background-color: var(--primary-color);
    color: white;
}

.first-time-image-upload {
    width: 100%;
    margin-top: 20px;
}

.first-time-upload-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

.first-time-url-upload,
.first-time-file-upload {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 10px;
    max-width: 250px;
}

.first-time-url-upload h3,
.first-time-file-upload h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.first-time-url-upload input,
.first-time-file-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
}

.first-time-url-upload button,
.first-time-file-upload button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.first-time-url-upload button:hover,
.first-time-file-upload button:hover {
    background-color: var(--secondary-color);
}

/* Dark mode styles for first-time upload */
body.dark-mode .first-time-url-upload,
body.dark-mode .first-time-file-upload {
    background-color: #1e1e1e;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .first-time-upload-options {
        flex-direction: column;
        align-items: center;
    }

    .first-time-url-upload,
    .first-time-file-upload {
        max-width: 100%;
        width: 100%;
        margin-bottom: 15px;
    }
}

#imageUploadModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999; 
    animation: fadeIn 0.3s ease-out;
}

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

#imageUploadModal .modal-content {
    background-color: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#imageUploadModal .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #888;
    z-index: 10000;
}

@media screen and (max-width: 600px) {
    #imageUploadModal .modal-content {
        width: 95%;
        margin: 0 10px;
        padding: 20px;
    }

    .upload-options {
        flex-direction: column;
        gap: 20px;
    }

    .url-upload, .file-upload {
        width: 100%;
    }
}

.export-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.export-card {
    background-color: var(--background-color);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease;
}

.export-card:hover {
    transform: translateY(-10px);
}

.export-icon {
    width: 80px;
    height: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.export-card h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.export-card p {
    color: var(--text-color);
    margin-bottom: 20px;
}

.export-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.export-button:hover {
    background-color: var(--secondary-color);
}

.export-help {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
}

/* Action Notification Styles */
.action-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1100;
    animation: slideInUp 0.3s ease-out, fadeOut 0.3s ease-in 3s forwards;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    width: 24px;
    height: 24px;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Dark mode styles for export and notification */
body.dark-mode .export-card {
    background-color: #1e1e1e;
}

body.dark-mode .export-help {
    color: #999;
}