* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    color: white;
    margin-bottom: 40px;
}

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

.header-content > div:first-child {
    text-align: center;
    flex: 1;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.user-menu.hidden {
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: auto;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
    }
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 968px) {
    main {
        grid-template-columns: 1fr;
    }
}

section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="url"],
input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="url"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 0.85rem;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

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

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.refresh-btn {
    margin-bottom: 20px;
    background: #4caf50;
}

.refresh-btn:hover {
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.qr-display {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.qr-display.hidden {
    display: none;
}

.qr-image-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.qr-image-container img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.qr-description {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.qr-description.hidden {
    display: none;
}

.qr-description p {
    margin: 0;
    color: #1565c0;
    font-size: 1rem;
}

.qr-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.qr-info p {
    margin-bottom: 10px;
    word-break: break-all;
}

.qr-info p:last-child {
    margin-bottom: 0;
}

.qr-list {
    display: grid;
    gap: 20px;
}

.qr-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.qr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.qr-card.expired {
    opacity: 0.6;
    border-color: #f44336;
}

.qr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.qr-card-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 5px;
}

.qr-card-info {
    flex: 1;
    margin-left: 15px;
}

.qr-card-info h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.qr-card-info p {
    font-size: 0.85rem;
    color: #888;
    word-break: break-all;
    margin-bottom: 5px;
}

.qr-card-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
}

.status-active {
    background: #4caf50;
    color: white;
}

.status-expired {
    background: #f44336;
    color: white;
}

.status-expiring-soon {
    background: #ff9800;
    color: white;
}

.delete-btn {
    background: #f44336;
    padding: 8px 16px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.delete-btn:hover {
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.loading,
.empty {
    text-align: center;
    color: #777;
    padding: 40px;
    font-style: italic;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #c62828;
}

.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #2e7d32;
}

