:root {
    --primary-color: #2196F3;
    --hover-color: #1976D2;
    --error-color: #f44336;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
    --text-color: #333;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

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

/* Header styles */
header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    height: 80px;
    width: auto;
    max-width: 90%;
    transition: transform 0.2s ease;
}

@media (max-width: 768px) {
    .logo {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 50px;
    }
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

/* Connection section styles */
#connection-section {
    background: var(--card-background);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin-bottom: 2rem;
}

.peer-info {
    margin-bottom: 2rem;
}

.peer-id-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    background: var(--background-color);
    padding: 10px;
    border-radius: 4px;
}

#peer-id {
    flex: 1;
    word-break: break-all;
    font-family: monospace;
}

.peer-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: var(--border-color);
}

.icon-button .material-icons {
    font-size: 20px;
    color: var(--text-color);
}

/* QR Code styles */
#qrcode-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

#qrcode {
    padding: 10px;
    background: white;
    border-radius: 4px;
}

/* Connect peer styles */
.connect-peer {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.peer-input-container {
    flex: 1;
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.button.primary:hover {
    background-color: var(--hover-color);
}

/* Status indicator styles */
.status {
    margin-top: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--error-color);
    transition: background-color 0.3s;
}

.status-dot.connecting {
    background-color: var(--warning-color);
    animation: pulse 1.5s infinite;
}

.status-dot.connected {
    background-color: var(--success-color);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* File transfer section styles */
#file-transfer-section {
    background: var(--card-background);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 2rem;
}

.drop-zone:hover {
    border-color: var(--primary-color);
}

.drop-zone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #666;
}

.drop-zone-text .material-icons {
    font-size: 48px;
    color: var(--primary-color);
}

input[type="file"] {
    display: none;
}

/* Progress bar styles */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background-color: var(--background-color);
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0;
    transition: width 0.3s;
}

/* Files history styles */
.files-history {
    margin-top: 2rem;
}

.files-section {
    margin-bottom: 2rem;
}

.files-list {
    list-style: none;
}

.files-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s, background 0.3s ease;
}

.files-list li:hover {
    background-color: #f0f0f0;
}

.files-list .material-icons {
    color: var(--primary-color);
    font-size: 24px;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-color);
    word-break: break-all;
    margin-bottom: 2px;
}

.file-size {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 2px;
}

.shared-by {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.download-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: var(--primary-color);
    transition: background-color 0.2s;
}

.download-button:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.download-button .material-icons {
    font-size: 20px;
}

.download-progress-text {
    color: var(--primary-color);
    font-weight: bold;
    font-family: monospace;
    font-size: 1rem;
}

/* Files sections */
.files-section {
    background: var(--card-background);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.files-section h3 {
    margin: 0 0 16px 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Recent peers dropdown */
.recent-peers {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px var(--shadow-color);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.recent-peers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

.clear-peers {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.clear-peers:hover {
    background-color: var(--border-color);
}

#recent-peers-list {
    list-style: none;
}

#recent-peers-list li {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#recent-peers-list li:hover {
    background-color: var(--background-color);
}

/* Utility classes */
.hidden {
    display: none !important;
}

.warning {
    color: var(--warning-color);
    margin-bottom: 1rem;
}

/* Notifications */
.notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: var(--card-background);
    border-radius: 4px;
    padding: 10px 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px var(--shadow-color);
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .input-group {
        flex-direction: column;
    }

    .button {
        width: 100%;
        justify-content: center;
    }

    .peer-id-container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .peer-actions {
        justify-content: center;
    }

    #qrcode {
        max-width: 100%;
        height: auto;
    }

    .drop-zone {
        padding: 20px;
    }

    .files-list li {
        flex-direction: column;
        text-align: center;
    }

    .download-button {
        margin-top: 10px;
    }
}

/* Download completed styles */
.files-list li.download-completed {
    background: rgba(76, 175, 80, 0.1);  /* Light green background */
}

.icon-button.download-completed {
    color: #4CAF50;  /* Green color for completed icon */
}

/* Peer ID editing styles */
.peer-id-display {
    display: flex;
    align-items: center;
    flex: 1;
}

.peer-id-edit {
    font-size: 1rem;
    padding: 4px 8px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    background: var(--background-color);
    color: var(--text-color);
    width: 100%;
    max-width: 100%;
    min-width: 200px;
    font-family: monospace;
    box-sizing: border-box;
    overflow-x: auto;
}

.peer-id-edit.hidden {
    display: none;
}

#peer-id.hidden {
    display: none;
}

.icon-button.hidden {
    display: none;
}

/* Disabled edit button state */
.icon-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.icon-button:disabled:hover {
    background-color: transparent;
}
