*{box-sizing: border-box;}

body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
    margin: 0;
    padding: 0;
}

.header {
    background-color: #f8f8f8;
    color: #000000;
    padding: 20px;
    text-align: center;
    width: 100%;
}

.header h1 {
    margin: 0;
    font-size: 2.5rem;
    color: #000000;
}

a {
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000000;
    color: white;
    padding: 12px 24px;
    border-radius: 0;
    font-size: 16px;
    font-weight: bold;
    z-index: 1000;
    animation: toast-appear 0.3s ease-out;
}

@keyframes toast-appear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.fade-out {
    animation: toast-disappear 0.3s ease-in forwards;
}

@keyframes toast-disappear {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

.container {
    text-align: center;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background-color: white;
    margin: 0 auto;
}

.description {
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: #000000;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}


h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #000000;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 20px;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 100;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sensitivity-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #f0f0f0;
    padding: 10px 20px;
    margin-bottom: 20px;
}

.sensitivity-container label {
    font-size: 1rem;
    white-space: nowrap;
}

.sensitivity-container input[type="range"] {
    width: 150px;
    margin: 0 10px;
}

.sensitivity-container span {
    font-size: 1rem;
    min-width: 30px;
    text-align: center;
}

button {
    background-color: #000000;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    position: relative;
    border-radius: 4px;
    overflow: visible;
}

button:hover {
    background-color: #333333;
}

button:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}

button.stop-btn {
    background-color: #dc3545;
    color: white;
}

button.loading {
    padding-right: 45px;
}

button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 15px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: button-loading-spinner 1s linear infinite;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
    z-index: 1;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 0 4px 4px;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }
    to {
        transform: rotate(1turn);
    }
}


.audio-placeholder, .detection-placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.detection-section, .dog-log-section, .log-section, .debug-log-section {
    margin: 30px 0;
    text-align: left;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#debugLogContainer {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.dog-log-section {
    margin-bottom: 200px;
}

#detectionList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-left: 4px solid #000000;
}

.detection-item.above-tolerance {
    border-left-color: green;
    background-color: green;
}

.detection-item.above-tolerance .class-name,
.detection-item.above-tolerance .confidence {
    color: white;
}

.detection-item.below-tolerance {
    border-left-color: lightgreen;
    background-color: lightgreen;
}

.detection-item .class-name {
    font-weight: bold;
}

.detection-item .confidence {
    color: #000000;
    font-weight: bold;
}

.placeholder-item .confidence {
    color: #666;
}

#dogLogTable {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    color: #000000;
}

#dogLogTable th, #dogLogTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #000000;
}

#dogLogTable th {
    background-color: #f0f0f0;
    font-weight: bold;
    color: #000000;
}

#dogLogTable tbody tr:nth-child(even) {
    background-color: #f0f0f0;
}

#dogLogTable tbody tr:hover {
    background-color: #cccccc;
}

#dogLogTable td:last-child {
    padding: 12px 4px;
    text-align: right;
    width: 30px;
}

.placeholder-row {
    color: #666;
    font-style: italic;
}

.placeholder-row td {
    color: #666;
}

.play-btn {
    padding: 6px 10px;
    font-size: 14px;
    min-width: 35px;
    background-color: #000000;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    background-color: #333333;
}

.delete-btn {
    padding: 0;
    font-size: 34px;
    font-weight: bold;
    background: none;
    color: #dc3545;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    width: 34px;
    height: 34px;
}

.delete-btn:hover {
    color: white;
    background-color: #666666;
}

.icon-btn {
    background-color: white !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    padding: 8px 12px !important;
    font-size: 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.icon-btn:hover {
    background-color: #f8f8f8 !important;
    border-color: #bbb !important;
}

.donation-section {
    margin: 30px 0;
    text-align: center;
}

.paypal-button {
    display: inline-block;
    background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
    color: #003087 !important;
    text-decoration: none !important;
    padding: 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 48, 135, 0.15);
    transition: all 0.3s ease;
    position: relative;
    width:100%;
    overflow: hidden;
}

.paypal-button:hover {
    text-decoration: none !important;
}

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

.paypal-button:hover::before {
    left: 100%;
}

.paypal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 112, 186, 0.4);
    text-decoration: none !important;
}

.paypal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: #003087 !important;
    position: relative;
    z-index: 1;
}

.donation-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
    font-weight: 500;
}

.paypal-logo {
    height: 38px;
    width: auto;
}

.sponsor-card {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    background: #f9f9f9;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.sponsor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.sponsor-card:hover::before {
    left: 100%;
}

.info-columns {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    overflow-y: auto;
    transition: max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.column {
    flex: 1;
    background-color: #f8f8f8;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.column h3 {
    margin-top: 0;
    color: #000000;
}

.column p {
    margin-bottom: 10px;
}

.column a {
    color: #000000;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.column a:hover {
    color: #333333;
    text-decoration: none;
}

.collapsible-section {
    position: relative;
    margin: 30px 0;
}

.collapsible-line {
    width: 100%;
    height: 2px;
    background-color: #ddd;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.collapsible-tab {
    position: absolute;
    right: 0;
    top: -12px;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.collapsible-tab:hover {
    background-color: #e8e8e8;
    border-color: #bbb;
}

.tab-text {
    font-weight: 500;
}

.collapsed .collapsible-line {
    background-color: #bbb;
}

.collapsed .collapsible-tab {
    top: -12px;
    background-color: #e8e8e8;
}

.info-columns.collapsed {
    max-height: 0;
    margin: 0;
    padding: 0;
}

.github-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    color: #000000 !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.github-button:hover {
    text-decoration: none !important;
}

.github-button:hover {
    background: #f8f8f8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
}

.github-button svg {
    fill: #000000;
    transition: transform 0.3s ease;
}

.github-button:hover svg {
    transform: scale(1.1);
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #000000;
    color: #ffffff;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 768px) {
    .footer {
        position: static;
        margin-top: 20px;
        padding-bottom: 20px;
    }
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.footer a {
    color: #ffffff;
    text-decoration: underline;
}

.footer a:hover {
    color: #cccccc;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-top: 0;
    color: #000;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

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

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

.confirm-btn {
    background-color: #007bff;
    color: white;
}

.confirm-btn:hover {
    background-color: #0056b3;
}

.close-btn {
    background-color: #28a745;
    color: white;
}

.close-btn:hover {
    background-color: #218838;
}

.share-link-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    align-items: center;
}

#shareLinkInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f8f8f8;
}

.copy-btn {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: #0056b3;
}





/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .controls {
        gap: 10px;
    }

    .sensitivity-container {
        flex-direction: column;
        gap: 8px;
        padding: 15px;
    }

    .sensitivity-container input[type="range"] {
        width: 100%;
        max-width: 200px;
    }


    .detection-section, .dog-log-section, .log-section, .audio-recording-section {
        padding: 15px;
    }

    #dogLogTable th, #dogLogTable td {
        padding: 8px 6px;
        font-size: 0.9rem;
    }

    .description {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .donation-section {
        margin: 20px 0;
    }

    .paypal-logo {
        height: 30px;
    }

    .paypal-button {
        padding: 15px;
    }

    .paypal-content {
        gap: 10px;
    }

    .info-columns {
        flex-direction: column;
        gap: 15px;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
    }

}
