/* LinkList - Personal Tools Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

/* Search Area Styles */
.search-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    width: 300px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-plus {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 300;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-plus:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Removed duplicate theme-selector rule - using the one in settings menu */

/* Header Controls Styles */
.header-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-dropdown,
.profile-dropdown {
    position: relative;
}

.btn-profile {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-profile:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.profile-icon {
    font-size: 18px;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: none;
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

.menu-section {
    margin-bottom: 8px;
}

.menu-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    padding: 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 4px;
}

.btn-settings {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.btn-settings:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: none;
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

.theme-selector {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin-bottom: 4px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.theme-selector:focus {
    outline: none;
    background-color: #e9ecef;
}

.menu-item {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
    margin-bottom: 4px;
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item:last-child {
    margin-bottom: 0;
}

.user-section {
    margin-top: 4px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 4px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.sign-out {
    color: #dc3545;
}

.sign-out:hover {
    background: #f8d7da;
}

/* Auth Section Styles */
.auth-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 80px;
    text-align: center;
}

.tool-card:hover {
    background: white;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.tool-icon {
    font-size: 32px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.tool-name {
    font-weight: 600;
    font-size: 11px;
    color: #2d3748;
    line-height: 1.2;
    word-break: break-word;
}

.tool-actions {
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    gap: 4px;
    position: absolute;
    top: 4px;
    right: 4px;
}

.tool-card:hover .tool-actions {
    opacity: 1;
}

.edit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 12px;
}

.edit-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    max-width: 250px;
    white-space: normal;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.tool-card:hover .tooltip {
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.sync-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 122, 255, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.sync-status.show {
    opacity: 1;
    transform: translateY(0);
}

.sync-status.success {
    background: rgba(34, 197, 94, 0.9);
}

.sync-status.error {
    background: rgba(239, 68, 68, 0.9);
}

.quick-add-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 122, 255, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.quick-add-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* Theme Styles */
.minimal-theme {
    background: #ffffff;
}

.minimal-theme .container {
    background: none;
}

.minimal-theme .header {
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: none;
    border: 1px solid #e5e5e5;
}

.minimal-theme .btn-plus,
.minimal-theme .btn-settings,
.minimal-theme .btn-profile {
    background: #000;
    color: white;
    border: 1px solid #000;
}

.minimal-theme .btn-plus:hover,
.minimal-theme .btn-settings:hover,
.minimal-theme .btn-profile:hover {
    background: #333;
    border-color: #333;
}

.minimal-theme .settings-menu,
.minimal-theme .profile-menu {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.minimal-theme .menu-label {
    color: #666;
}

.minimal-theme .user-details {
    background: #f8f9fa;
}

.minimal-theme .theme-selector {
    background: #f8f9fa;
    color: #333;
}

.minimal-theme .theme-selector:focus {
    background-color: #e9ecef;
}

.minimal-theme .menu-item {
    color: #333;
}

.minimal-theme .menu-item:hover {
    background: #f8f9fa;
}

.minimal-theme .user-profile {
    background: #f8f9fa;
}

.minimal-theme .user-name {
    color: #333;
}

.minimal-theme .sign-out {
    color: #dc3545;
}

.minimal-theme .sign-out:hover {
    background: #f8d7da;
}

.minimal-theme .search-input {
    background: white;
    border: 1px solid #d1d5db;
    color: #333;
}

.minimal-theme .btn-primary {
    background: #000;
    color: white;
    border: 1px solid #000;
}

.minimal-theme .btn-primary:hover {
    background: #333;
    border-color: #333;
}

.minimal-theme .btn-secondary {
    background: white;
    color: #000;
    border: 1px solid #d1d5db;
}

.minimal-theme .btn-secondary:hover {
    background: #f9f9f9;
    border-color: #000;
}

.minimal-theme .category-title {
    color: #666;
    text-shadow: none;
}

.minimal-theme .tool-card {
    background: white;
    backdrop-filter: none;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.minimal-theme .tool-card:hover {
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.02);
    border-color: #000;
}

.minimal-theme .tool-name {
    color: #000;
}

.minimal-theme .empty-state {
    color: #666;
}

.dark-theme {
    background: #1a1a1a;
    color: #e5e5e5;
}

.dark-theme .container {
    background: none;
}

.dark-theme .header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}


.dark-theme .btn-plus,
.dark-theme .btn-settings,
.dark-theme .btn-profile {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark-theme .btn-plus:hover,
.dark-theme .btn-settings:hover,
.dark-theme .btn-profile:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.dark-theme .settings-menu,
.dark-theme .profile-menu {
    background: #2a2a2a;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.dark-theme .menu-label {
    color: #e5e5e5;
}

.dark-theme .user-details {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .theme-selector {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
}

.dark-theme .theme-selector:focus {
    background-color: rgba(255, 255, 255, 0.15);
}

.dark-theme .menu-item {
    color: #e5e5e5;
}

.dark-theme .menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .user-profile {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .user-name {
    color: #e5e5e5;
}

.dark-theme .sign-out {
    color: #ef4444;
}

.dark-theme .sign-out:hover {
    background: rgba(239, 68, 68, 0.2);
}

.dark-theme .search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e5e5e5;
}

.dark-theme .search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.dark-theme .search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.dark-theme .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark-theme .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-theme .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-theme .category-title {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: none;
}

.dark-theme .tool-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dark-theme .tool-card:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.dark-theme .tool-name {
    color: #e5e5e5;
}

.dark-theme .empty-state {
    color: rgba(255, 255, 255, 0.7);
}

.dark-theme .modal-content {
    background: #2a2a2a;
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-theme .form-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e5e5e5;
}

.dark-theme .form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.dark-theme .form-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.dark-theme .close-btn {
    color: #e5e5e5;
}

.dark-theme .tooltip {
    background: #333;
    color: #e5e5e5;
}

.dark-theme .tooltip::after {
    border-top-color: #333;
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .search-area {
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .search-input {
        flex: 1;
        min-width: 0;
        max-width: none;
        width: auto;
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn-plus {
        width: 40px;
        height: 40px;
        font-size: 18px;
        flex-shrink: 0;
    }

    .header-controls {
        position: static;
        justify-content: center;
        gap: 12px;
    }

    .btn-settings,
    .btn-profile {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .settings-menu,
    .profile-menu {
        min-width: 200px;
        padding: 12px;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-5px);
    }

    .settings-menu.show,
    .profile-menu.show {
        transform: translateX(-50%) translateY(0);
    }

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

    .tool-card {
        min-height: 70px;
        padding: 10px 6px;
    }

    .tool-icon {
        font-size: 28px;
        width: 32px;
        height: 32px;
    }

    .tool-icon-img {
        width: 28px;
        height: 28px;
    }

    .tool-name {
        font-size: 10px;
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
    }

    .header {
        padding: 12px;
        gap: 12px;
    }

    .search-input {
        padding: 8px 12px;
        font-size: 14px;
    }

    .btn-plus,
    .btn-settings,
    .btn-profile {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .settings-menu,
    .profile-menu {
        min-width: 180px;
        padding: 8px;
    }

    .menu-item {
        padding: 10px;
        font-size: 13px;
    }

    .theme-selector {
        padding: 10px;
        font-size: 13px;
    }
}