/* Base Styles - Theme Agnostic */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
/* Removed @import for Font Awesome; using direct link in private.html for reliability */

:root {
    --primary-font: 'Poppins', sans-serif;
    --border-radius: 12px;
    
    /* Default/Fallback values - these should be overridden by theme files */
    --background-color: #f4f7f6;
    --surface-color: #ffffff;
    --primary-text-color: #333;
    --secondary-text-color: #666;
    --accent-color: #007bff;
    --accent-color-hover: #0056b3;
    --border-color: #e0e0e0;
    --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);

    --button-background: var(--accent-color);
    --button-text-color: #ffffff;
    --input-border-color: var(--border-color);
    --input-background: var(--surface-color);
    --text-color: var(--primary-text-color);
    --widget-background: var(--surface-color);
}

body {
    font-family: var(--primary-font);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: var(--background-color); /* Use theme variable */
    color: var(--text-color); /* Use theme variable */
}

.container {
    max-width: 1400px;
    margin: auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.header h1 {
    margin: 0;
    font-weight: 700;
}

.button {
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background-color: var(--button-background);
    color: var(--button-text-color);
    box-shadow: var(--box-shadow); /* Use theme variable */
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-gap: 25px;
    padding: 25px 0;
}

.widget {
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--box-shadow); /* Use theme variable */
    background-color: var(--widget-background); /* Use theme variable */
}

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

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.widget-header h3 {
    margin: 0;
    font-weight: 600;
}

.widget-menu {
    position: relative;
}

.widget-menu-button {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: var(--secondary-text-color); /* Use theme variable */
}

.widget-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    border-radius: var(--border-radius);
    list-style: none;
    padding: 10px 0;
    margin: 5px 0 0 0;
    display: none;
    z-index: 10;
    background-color: var(--widget-background);
    box-shadow: var(--box-shadow);
}

.widget-menu-dropdown.show {
    display: block;
}

.widget-menu-dropdown li {
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.widget-menu-dropdown li:hover {
    background-color: rgba(var(--primary-text-color-rgb), 0.1); /* Use RGB for transparency */
}

.widget.minimized .widget-content {
    display: none;
}

.widget-content {
    flex-grow: 1;
}

textarea, input[type="text"], input[type="url"], input[type="file"], .add-widget-form select {
    width: 100%;
    padding: 12px;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    margin-bottom: 15px;
    border: 1px solid var(--input-border-color);
    background-color: var(--input-background);
    color: var(--text-color);
}

textarea {
    height: 150px;
    resize: vertical;
}

.add-widget-form {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    align-items: center;
    padding: 20px;
    border-radius: var(--border-radius);
    background-color: var(--widget-background);
    box-shadow: var(--box-shadow);
}

.add-widget-form select {
    /* Specific styling for select in add-widget-form if needed, overrides general input */
}

/* Specific Widget Styles */
.widget-weather .temp {
    font-size: 3em;
    font-weight: 700;
}
.widget-weather .condition {
    font-size: 1.5em;
    margin-bottom: 10px;
}
.widget-weather .location {
    font-size: 1.2em;
}

.widget-bookmarks ul, .widget-notes ul {
    list-style: none;
    padding: 0;
}
.widget-bookmarks li, .widget-notes li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color); /* Consistent border */
}
.widget-bookmarks li:last-child, .widget-notes li:last-child {
    border-bottom: none; /* No border for the last item */
}


.widget-bookmarks a {
    text-decoration: none;
    transition: color 0.3s ease;
    color: var(--accent-color); /* Use theme variable */
}

.widget-bookmarks a:hover {
    color: var(--accent-color-hover); /* Use theme variable */
}

.widget-image .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.widget-image img {
    max-width: 100%;
    border-radius: var(--border-radius);
}

.autocomplete-results {
    position: absolute;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    z-index: 100;
    box-shadow: var(--box-shadow); /* Use theme variable */
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
}

.autocomplete-item:hover {
    background-color: rgba(var(--primary-text-color-rgb), 0.1); /* Use RGB for transparency */
}
