/* call/style.css */

#call-interface {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    align-items: center;
    position: relative;
    padding: var(--spacing-lg);
    text-align: center;
    overflow: auto;
}

.call-state-view {
    flex-grow: 1;
    display: none;
    /* display: flex; */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* justify-content: space-around; */
    width: 100%;
    max-width: 400px;
    /* min-height: 150px; */
    padding: var(--spacing-lg);
    gap: var(--spacing-sm);
    /* margin-bottom: 10rem; */
}

.call-state-view.active {
    display: flex;
}

.dialpad-container {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
}

.call-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.call-status-text {
    display: block;
    font-size: 0.825rem;
    color: var(--text-secondary);
    opacity: 0.8;
    transition: color 0.3s ease;
}
.call-status-text.error {
    color: var(--error-color);
    font-weight: 500;
}
.call-status-text.voicemail {
    color: var(--success-color);
    font-weight: 500;
}

.caller-id {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.call-timer {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-top: var(--spacing-xs);
}

.action-buttons {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    width: 100%;
}

/* Button colors */
button.success { background-color: var(--success-color); color: white; border-color: var(--success-color); }
button.success:hover { background-color: #146c43; border-color: #146c43; }
button.danger { background-color: var(--error-color); color: white; border-color: var(--error-color); }
button.danger:hover { background-color: #b02a37; border-color: #b02a37; }

#phone-number-input {
    font-family: var(--font-mono);
    flex-grow: 1;
    border-radius: 18px;
    padding: 10px 15px;
    font-size: 1.1rem;
    overflow-y: auto;
    max-height: 100px;
    min-height: 45px;
    line-height: 1.4;
    resize: none;
    letter-spacing: 1px;
    /* Base styles handle bg, color, border, focus */
}

.action-button {
    /* Inherits .icon-button, .primary */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 8px;  /* Adjust padding for icon centering */
}
.action-button svg {
    width: 20px;
    height: 20px;
    fill: var(--icon-color-accent);  /* Ensure icon color */
}
.action-button:disabled {
    background-color: var(--text-secondary);  /* Grey out disabled */
    opacity: 0.6;
    cursor: not-allowed;
    border-color: transparent;
}
html[data-theme="dark"] .action-button:disabled {
    background-color: var(--bg-tertiary);
}

.dtmf-input-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 300px;
    /* margin-top: var(--spacing-lg); */
    margin-top: 64px;
}
.dtmf-input {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 300px;
}
.dtmf-send-button,
.dtmf-backspace-button {
    flex-grow: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 40px;
    padding: 0;
    border-radius: var(--border-radius);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.dtmf-backspace-button:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.05);
}
.dtmf-send-button {
    background-color: var(--success-color);
    color: white;
    transition: opacity 0.3s ease, transform 0.2s ease;
}
.dtmf-send-button:hover {
    opacity: 0.8;
}
.dtmf-button-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    width: 100%;
    max-width: 300px;
}
.dtmf-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 40px;
    border-radius: 12px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.dtmf-button:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.05);
}

.missed-calls {
    font-size: 0.825rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* gap: var(--spacing-sm); */
    width: 100%;
    max-width: 300px;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--bg-tertiary);
    /* margin-top: 100px; */
}
.missed-calls .missed-calls-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}
.missed-calls .missed-calls-list {
    /* font-size: 0.825rem; */
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-height: 200px;
    overflow: auto;
}
.missed-calls li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    cursor: pointer;
    border-bottom: 1px solid var(--bg-secondary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}
.missed-calls li:hover {
    background-color: var(--bg-secondary);
}

/* Animations */
.status-animation {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--bg-accent);
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}
.status-animation.ringing {
    border-color: var(--bg-tertiary);
    border-top-color: var(--success-color);
    border-right-color: var(--success-color);
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

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

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.8; }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .dialpad-container {
        flex-direction: column;
        align-items: center;
    }
    #phone-number-input {
        font-size: 0.8rem;
    }
    .action-button {
        width: 50px;
        height: 50px;
        padding: 6px;
    }
    .caller-id { font-size: 1.5rem; }
    /* .action-button.large { width: 70px; height: 70px; }
    .action-button.large svg { width: 24px; height: 24px; }
    .action-buttons { gap: var(--spacing-md); } */
}
