:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --sidebar-width: 250px;
    --header-height: 60px;
    --footer-height: 50px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-links {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-item a:hover,
.nav-item.active a {
    background-color: rgba(255,255,255,0.1);
}

.nav-item i {
    width: 20px;
    margin-right: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.top-header {
    height: var(--header-height);
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.search-box {
    flex: 1;
    max-width: 600px;
    display: flex;
    align-items: center;
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
}

.search-box i {
    color: #666;
    margin-right: 10px;
}

.search-box input {
    border: none;
    background: none;
    padding: 0;
    width: 100%;
    font-size: 14px;
    color: var(--text-color);
}

.search-box input:focus {
    outline: none;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.header-btn:hover {
    background-color: var(--background-color);
}

.header-btn i {
    font-size: 16px;
}

.header-btn span {
    font-size: 14px;
}

#toggle-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    font-size: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    #toggle-sidebar {
        display: block;
    }

    .header-btn span {
        display: none;
    }

    .header-btn {
        padding: 8px;
    }

    .header-btn i {
        font-size: 20px;
    }
}

/* Content Wrapper */
.content-wrapper {
    padding: 20px;
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
}

/* Password Grid */
.password-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.password-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.2s;
}

.modal-content {
    position: relative;
    background-color: white;
    width: 90%;
    max-width: 800px;
    margin: 30px auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    animation: slideIn 0.3s;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--text-color);
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.flex-1 {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
    padding: 0;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.2s;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.password-input {
    display: flex;
    gap: 8px;
}

.password-input input {
    flex: 1;
}

.password-input button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0 8px;
}

.form-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    position: sticky;
    bottom: 0;
}

.cancel-btn {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: all 0.2s;
}

.cancel-btn:hover {
    background-color: #e9ecef;
}

.save-btn {
    padding: 8px 16px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.save-btn:hover {
    background-color: #2980b9;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Footer Styles */
.main-footer {
    height: var(--footer-height);
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    right: 0;
    left: var(--sidebar-width);
}

/* Responsive Design */
@media (max-width: 768px) {
    #toggle-sidebar {
        display: block;  /* Show on mobile */
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .top-header {
        left: 0;
    }

    .main-footer {
        left: 0;
    }
}

.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.dashboard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* User Profile Section */
.user-profile {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 5px 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    cursor: pointer;
}

.username {
    font-weight: 500;
    color: var(--text-color);
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: var(--background-color);
}

.action-btn.logout {
    color: var(--accent-color);
}

.action-btn i {
    width: 16px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dashboard Content Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h1 {
    font-size: 24px;
    color: var(--text-color);
    font-weight: 600;
}

.add-password-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.add-password-btn:hover {
    background-color: #2980b9;
}

.add-password-btn i {
    font-size: 16px;
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}


.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .user-name {
    font-weight: 600;
    color: var(--text-color);
}

.user-info .user-email {
    font-size: 12px;
    color: #666;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--background-color);
}

.dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dropdown-item.text-danger {
    color: var(--accent-color);
}

.dropdown-item.text-danger:hover {
    background-color: #fff5f5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Tags Input Styles */
.tags-input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px;
    background-color: #fff;
}

.tags-input:focus-within {
    border-color: var(--secondary-color);
}

.tags-input ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tags-input #tag-input {
    border: none;
    outline: none;
    padding: 5px;
    font-size: 14px;
    flex: 1;
    min-width: 100px;
}

.tags-input .tag {
    background-color: var(--background-color);
    border-radius: 3px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.tags-input .tag .remove-tag {
    cursor: pointer;
    color: #666;
    font-size: 12px;
    padding: 2px;
}

.tags-input .tag .remove-tag:hover {
    color: var(--accent-color);
}

/* DataTable Styles */
.credentials-table {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-buttons button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-buttons .view-btn {
    color: var(--secondary-color);
}

.action-buttons .copy-btn {
    color: var(--primary-color);
}

.action-buttons .edit-btn {
    color: #28a745;
}

.action-buttons .delete-btn {
    color: var(--accent-color);
}

.action-buttons button:hover {
    background-color: var(--background-color);
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px;
}

/* Password display styles */
.password-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: monospace;
    background-color: var(--background-color);
    padding: 4px 8px;
    border-radius: 4px;
    max-width: fit-content;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 16px;
}

.action-buttons .btn {
    cursor: pointer;
    padding: 6px;
    border: none;
    background: none;
    transition: all 0.2s;
}

.action-buttons .btn:hover {
    transform: scale(1.1);
} 