@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
    --primary-color: #6366f1;
    --secondary-color: #a855f7;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.2);
    --card-border: rgba(255, 255, 255, 0.3);
    --text-color: #ffffff;
    --text-secondary: #e2e8f0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    margin-top: 5vh; /* Initial spacing */
    transition: margin 0.5s ease;
}

/* Remove card effect from main container to feel 'open' like a search engine */
.glass-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    text-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-top: 0;
}

.search-section {
    position: sticky;
    top: 20px;
    z-index: 50;
    background: transparent;
}

.search-box {
    position: relative;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 1rem 2rem;
    border-radius: 50px; /* Pill shape */
    border: none;
    background: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    color: #333;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    transform: scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 15px;
    display: inline-flex; /* Center independently */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.btn-add {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.link-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: white;
    display: block;
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.link-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    padding-right: 20px; /* Space for edit icon */
}

.link-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.link-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.5;
}

.btn-edit {
    position: absolute;
    top: 1rem;
    right: 3rem;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    font-size: 1.2rem;
    z-index: 100;
}

.btn-edit:hover {
    opacity: 1;
    color: var(--secondary-color);
}

.btn-delete {
    position: absolute;
    top: 1rem;
    right: 5rem;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    font-size: 1.2rem;
    z-index: 100;
}

.btn-delete:hover {
    opacity: 1;
    color: #ef4444; /* Red */
}

.btn-save-web {
    position: absolute;
    top: 1rem;
    right: 1rem; /* Replaces the link-icon visually or sits next to it */
    background: #10b981; /* Green */
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn-save-web:hover {
    transform: scale(1.1);
    background: #059669;
}



/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fff;
    color: #333;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlide 0.4s ease;
}

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

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #000;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.btn-submit {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: var(--secondary-color);
}

/* List View for Web Search (Search Engine Style) */
.links-grid.list-view {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.links-grid.list-view .link-card-wrapper {
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.links-grid.list-view .link-card {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.links-grid.list-view .link-card:hover {
    transform: none;
    background: transparent;
    box-shadow: none;
}

.links-grid.list-view .link-card h3 {
    color: #a5b4fc; /* Light blue-ish for dark theme similarity to Google link */
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
    text-decoration: none;
}
.links-grid.list-view .link-card:hover h3 {
    text-decoration: underline;
}

.links-grid.list-view .link-card p {
    color: #e2e8f0;
    font-size: 1rem;
    max-width: 90%;
}

.links-grid.list-view .link-icon {
    display: none; /* Hide icon for true SERP look, or make it small next to URL */
}

/* Adjust Save Button position for list view */
.links-grid.list-view .btn-save-web {
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.1);
    transform: scale(0.8);
}
.links-grid.list-view .btn-save-web:hover {
    background: #10b981;
    transform: scale(0.9);
}
