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

/* Screen reader only class for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #0f1419, #1a1f2e, #252b3d, #1e2433);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.landing-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(90, 159, 212, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.landing-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(90, 159, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(123, 104, 238, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(90, 159, 212, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.landing-content {
    max-width: 1000px;
    text-align: center;
    color: var(--text-color);
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-content h1 {
    font-size: 64px;
    margin-bottom: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #5a9fd4 0%, #7b68ee 50%, #5a9fd4 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    letter-spacing: -2px;
    position: relative;
}

.landing-content h1::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: linear-gradient(135deg, #5a9fd4 0%, #7b68ee 50%, #5a9fd4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(20px);
    opacity: 0.5;
}

@keyframes shimmer {
    to {
        background-position: 200% center;
    }
}

.landing-description {
    font-size: 22px;
    margin: 20px 0 60px;
    color: var(--text-color);
    opacity: 0.95;
    line-height: 1.7;
    max-width: 700px;
    font-weight: 300;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
    margin: 60px 0;
    padding: 0 20px;
    width: 100%;
    max-width: 100%;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.feature {
    padding: 40px 30px;
    background: rgba(37, 43, 61, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(90, 159, 212, 0.2);
    position: relative;
    overflow: hidden;
}

.feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(90, 159, 212, 0.1) 0%, rgba(123, 104, 238, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature:hover::before {
    opacity: 1;
}

.feature:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(90, 159, 212, 0.3),
        0 0 0 1px rgba(90, 159, 212, 0.5);
    border-color: rgba(90, 159, 212, 0.5);
}

.feature-icon {
    font-size: 72px;
    display: block;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(90, 159, 212, 0.4));
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.feature:hover .feature-icon {
    filter: drop-shadow(0 10px 30px rgba(90, 159, 212, 0.7));
    transform: scale(1.1) translateY(-5px);
}

.feature:nth-child(1) .feature-icon {
    animation-delay: 0s;
}

.feature:nth-child(2) .feature-icon {
    animation-delay: 0.5s;
}

.feature:nth-child(3) .feature-icon {
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

.feature h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-color);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.feature p {
    font-size: 16px;
    color: var(--text-color);
    opacity: 0.85;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.btn-large {
    padding: 20px 60px;
    font-size: 20px;
    font-weight: 700;
    margin-top: 50px;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #5a9fd4 0%, #7b68ee 100%);
    border: none;
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(90, 159, 212, 0.4);
    animation: fadeInUp 1s ease-out 0.6s both, pulse 2s ease-in-out infinite;
}

.btn-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-large:hover::before {
    left: 100%;
}

.btn-large:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(90, 159, 212, 0.5),
        0 0 0 4px rgba(90, 159, 212, 0.2);
}

.btn-large:active {
    transform: translateY(-1px) scale(1.02);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(90, 159, 212, 0.4);
    }
    50% {
        box-shadow: 0 10px 40px rgba(90, 159, 212, 0.6);
    }
}

.landing-footer {
    margin-top: 50px;
    font-size: 15px;
    color: var(--text-color);
    opacity: 0.75;
    animation: fadeInUp 1s ease-out 0.8s both;
    font-weight: 300;
}

:root {
    --primary-color: #5a9fd4;
    --secondary-color: #7b68ee;
    --bg-color: #1a1f2e;
    --text-color: #e4e6eb;
    --border-color: #2d3548;
    --widget-bg: #252b3d;
    --widget-hover: #2d3548;
    --header-bg: #1e2433;
    --entry-bg: #2d3548;
    --font-family: Arial, sans-serif;
    --base-font-size: 14px;
}

body {
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 0;
    margin: 0;
}

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

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: var(--header-bg);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h1 {
    font-size: 20px;
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    gap: 10px;
}

.header-controls .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.controls-panel {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 15px 20px;
    background: var(--widget-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
}

.control-group input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--entry-bg);
    color: var(--text-color);
}

.control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.badges-container {
    display: flex;
    gap: 20px;
    position: relative;
}

.badge-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Allows flex items to shrink below content size */
    align-items: stretch; /* Badges fill column width */
    align-content: flex-start; /* Items align to start, no cross-axis alignment */
}

.drop-indicator {
    border: 2px dashed var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
    position: absolute;
}

.badge {
    background: var(--widget-bg);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: move;
    min-height: fit-content;
    position: relative;
    overflow: hidden;
    align-self: start;
    height: auto;
    grid-row: auto;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
}

.badge.edit-mode {
    border: 2px dashed var(--primary-color);
    cursor: default;
}

.badge.edit-mode .badge-header {
    pointer-events: none;
}

.badge.edit-mode .feed-entries {
    pointer-events: none;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    background: var(--widget-hover);
}

.badge.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.badge-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--primary-color);
    cursor: ns-resize;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.badge.edit-mode .badge-resize-handle {
    opacity: 1;
}

.badge-resize-handle:hover {
    background: #357abd;
    height: 10px;
}

.badge-resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

.badge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    padding-right: 5px;
    border-bottom: 2px solid var(--border-color);
}

.badge-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
}

.badge-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

body.controls-hidden .badge-actions {
    display: none !important;
}

body.controls-hidden #settingsBtn {
    display: none !important;
}

#toggleControlsBtn {
    min-width: 40px;
    padding: 8px 12px;
}

.badge-actions button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s;
    color: var(--text-color);
}

.badge-actions button:hover {
    background: rgba(255,255,255,0.2);
}

.feed-entries {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.feed-entry {
    padding: 12px;
    background: var(--entry-bg);
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.2s;
}

.feed-entry:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transform: translateX(3px);
    background: var(--widget-hover);
}

.feed-entry-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
}

.feed-entry-title a {
    color: inherit;
    text-decoration: none;
}

.feed-entry-title a:hover {
    text-decoration: underline;
}

.feed-entry-description {
    font-size: 14px;
    color: #b0b3b8;
    line-height: 1.5;
    display: none;
}

.feed-entry-description.show {
    display: block;
}

.feed-entry-date {
    font-size: 12px;
    color: #8a8d91;
    margin-top: 8px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--widget-bg);
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

#feedSettingsModal .modal-content {
    max-width: 500px;
}

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

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #ff6b6b;
    opacity: 0.8;
}

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

.form-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--entry-bg);
    color: var(--text-color);
}

.settings-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.settings-column {
    display: flex;
    flex-direction: column;
}

.form-group-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.form-group-row .form-group {
    margin-bottom: 0;
}

.form-group-row .form-group:first-child {
    min-width: 180px;
}

.form-group-row .form-group input[type="number"] {
    width: 100%;
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #8a8d91;
}

.error {
    padding: 10px;
    background: #fee;
    color: #c33;
    border-radius: 4px;
    margin-top: 10px;
}

.settings-preview {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    background: var(--entry-bg);
    margin-top: 10px;
    max-width: 100%;
    box-sizing: border-box;
}

.preview-badge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.preview-badge-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
}

.preview-feed-entry {
    padding: 12px;
    background: var(--widget-bg);
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
}

.preview-entry-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 3px;
}

.preview-entry-description {
    font-size: 14px;
    color: #b0b3b8;
    line-height: 1.5;
    margin-top: 8px;
}

.link-list-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--entry-bg);
    border-radius: 4px;
    align-items: center;
}

.link-list-item input[type="text"],
.link-list-item input[type="url"] {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--widget-bg);
    color: var(--text-color);
}

.link-list-item button {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.link-list-item button:hover {
    background: #c82333;
}

/* Login Modal Styles */
#loginModal .modal-content {
    max-width: 400px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form h2 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-form .error-message {
    padding: 10px;
    background: #fee;
    color: #c33;
    border-radius: 4px;
    margin-bottom: 10px;
    display: none;
}

.login-form .error-message.show {
    display: block;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--entry-bg);
    color: var(--text-color);
}

.login-form button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.login-form button:hover {
    background-color: #357abd;
}

.login-form button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.user-info .username {
    font-weight: 500;
    color: var(--text-color);
}

.user-info .logout-btn {
    padding: 6px 12px;
    font-size: 13px;
    background-color: #dc3545;
}

.user-info .logout-btn:hover {
    background-color: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
    .landing-content h1 {
        font-size: 42px;
        letter-spacing: -1px;
    }
    
    .landing-description {
        font-size: 18px;
        margin: 20px 0 40px;
    }
    
    .landing-features {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 10px;
        margin: 40px 0;
    }
    
    .feature {
        padding: 30px 20px;
    }
    
    .feature-icon {
        font-size: 60px;
    }
    
    .btn-large {
        padding: 16px 45px;
        font-size: 18px;
        margin-top: 40px;
    }
    
    .landing-footer {
        margin-top: 40px;
        font-size: 14px;
    }
    
    .badges-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .landing-content h1 {
        font-size: 36px;
    }
    
    .landing-description {
        font-size: 16px;
    }
    
    .feature {
        padding: 25px 15px;
    }
    
    .btn-large {
        padding: 14px 35px;
        font-size: 16px;
    }
}

