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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
    position: relative;
}

header h1 {
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 18px;
    opacity: 0.9;
}

.logout-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.app-card {
    background: white;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.app-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.app-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.app-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.app-status {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.app-status.online {
    background: #e8f5e9;
    color: #2e7d32;
}

.app-status.offline {
    background: #ffebee;
    color: #c62828;
}

.app-card.placeholder {
    opacity: 0.8;
    cursor: pointer;
    border: 2px dashed #ddd;
    background: rgba(255, 255, 255, 0.5);
}

.app-card.placeholder:hover {
    opacity: 1;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.app-card.placeholder::before {
    display: none;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 14px;
}

/* Blur effect for authenticated state */
.container.blurred {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: slideInLogin 0.4s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.login-header p {
    font-size: 16px;
    color: #666;
}

/* Honeypot field - completely hidden */
#username {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.login-error {
    color: #f44336;
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    min-height: 20px;
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* Edit button for custom apps */
.edit-btn {
    position: absolute;
    top: 10px;
    right: 50px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #2196F3;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: #1976D2;
    transform: scale(1.1);
}

/* Delete button for custom apps */
.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f44336;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* 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.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.close {
    font-size: 32px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close:hover {
    color: #333;
}

/* Form Styles */
#addAppForm {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Icon Picker */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.icon-option {
    font-size: 32px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.icon-option:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.icon-option.selected {
    border-color: #667eea;
    background: #f0f0ff;
    transform: scale(1.1);
}

.selected-icon-display {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.selected-icon-display span {
    font-size: 20px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 36px;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .icon-picker {
        grid-template-columns: repeat(4, 1fr);
    }

    .modal-content {
        width: 95%;
    }
}
